hi have 1 problem. po file doesn't work. use qtransltae-x translation. , create custom pot file
example
# copyright (c) 2015 gawatt msgid "" msgstr "" "project-id-version: gawatt 1.0.0\n" "pot-creation-date: 2015-06-03 11:30+0400\n" "mime-version: 1.0\n" "content-type: text/plain; charset=utf-8\n" "content-transfer-encoding: 8bit\n" "po-revision-date: 2015-mo-da ho:mi+zone\n" "last-translator: full name <email@address>\n" "language-team: language <ll@li.org>\n" "x-generator: poedit 1.8.1\n" #: club.php:25 msgid "zibil" msgstr ""
after generate it`
# copyright (c) 2015 gawatt msgid "" msgstr "" "project-id-version: gawatt 1.0.0\n" "pot-creation-date: 2015-06-03 11:30+0400\n" "mime-version: 1.0\n" "content-type: text/plain; charset=utf-8\n" "content-transfer-encoding: 8bit\n" "po-revision-date: 2015-06-03 12:45+0400\n" "x-generator: poedit 1.7.6\n" "last-translator: \n" "language-team: \n" "plural-forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "language: ru_ru\n" #: club.php:25 msgid "zibil" msgstr "sdfsdfsdfsdf"
code output `
<?php _e('zibil'); ?>
and in wp-config
define('wplang', 'ru_ru');
but when switch language russina doesn't work, can please me thank you.
if want translate theme need tell wordpress find translation files using: <?php load_theme_textdomain( $domain, $path ) ?>
, doc.
for example:
add_action('after_setup_theme', 'my_theme_setup'); function my_theme_setup(){ load_theme_textdomain('my_theme', get_template_directory() . '/languages'); }
and when using function _e()
have include domain, doc
like so: <?php _e('zibil', 'mytheme'); ?>
.
Comments
Post a Comment