WordPress主题.pot语言文件

时间:2013-05-14 00:57:16

标签: wordpress themes translate

我购买了一个WordPress主题,其中包含.pot语言文件位于以下路径:

    ./wp-content/themes/THEME_NAME/include/languages/THEME_NAME.pot

我用Poedit软件翻译了一些短语并替换了新的.pot文件;但它没有影响到结果!!所有短语仍然是默认语言!

参加我将以下代码放到wp-config.php文件中:

    define('WPLANG', 'language_COUNTRY');

此外,模板还有一个选项,可以禁用小型管理员侧转换器,并启用.pot文件来处理所有短语;我在这里切换到.pot文件。

我还在文件名和文件路径上做了一些Try& Error,但没有成功。实际上我已经将它命名为其他一些东西以及其他一些文件扩展名并更改了文件位置:

    ./wp-content/themes/THEME_NAME/include/languages/language_COUNTRY.pot & .po & .mo
    ./wp-content/themes/THEME_NAME/include/languages/THEME_NAME-language_COUNTRY.pot & .po & .mo

    ./wp-content/themes/THEME_NAME/language_COUNTRY.pot & .po & .mo
    ./wp-content/themes/THEME_NAME/THEME_NAME-language_COUNTRY.pot & .po & .mo

    ./wp-content/languages/language_COUNTRY.pot & .po & .mo
    ./wp-content/languages/THEME_NAME-language_COUNTRY.pot & .po & .mo

    ./wp-content/languages/themes/language_COUNTRY.pot & .po & .mo
    ./wp-content/languages/themes/THEME_NAME-language_COUNTRY.pot & .po & .mo

    ./language_COUNTRY.pot & .po & .mo
    ./THEME_NAME-language_COUNTRY.pot & .po & .mo

在以下路径的PHP文件中使用了“load_theme_textdomain”函数:

    ./wp-content/themes/THEME_NAME/include/function-regist.php

代码的相关部分是:

    // enable theme to support the localization
    add_action('init', 'gdl_word_translation');
    function gdl_word_translation(){
        global $gdl_admin_translator;
        if( $gdl_admin_translator == 'disable' ){
            load_theme_textdomain( 'gdl_back_office', SERVER_PATH . '/include/languages/' );
            load_theme_textdomain( 'gdl_front_end', SERVER_PATH . '/include/languages/' );
        }
    }

现在,我该怎么做才能让它发挥作用?!

0 个答案:

没有答案