Plugin Author
Chouby
(@chouby)
If your theme is correctly internationalized and localized, you just have to create the language in Polylang and it will do all what is necessary to load the correct language.
will it show up in the “strings translation” tab in polylang settings, or replace the text with the replacement text provided in the .mo and .po files?
Rich
Here is what I have chouby:
in functions.php:
function ssm_localize_theme() {
// Retrieve the directory for the localization files
$lang_dir = CHILD_DIR . '/languages';
// Set the theme's text domain using the unique identifier from above
load_theme_textdomain('zoll', $lang_dir);
} // end ssm_localize_theme
add_action('after_setup_theme', 'ssm_localize_theme');
And then where necessary I have the items localized in the theme, like so:
<div class="language-picker">
<h4><?php _e('Choose Your Preferred Language', 'zoll'); ?></h4>
<?php pll_the_languages(array('dropdown'=>1)); ?>
</div>
Is this not correct?
Plugin Author
Chouby
(@chouby)
If CHILD_DIR is defined with get_stylesheet_directory()
, and if ‘zoll’ is a unique textdomain name (not the same as parent theme), then it looks correct.
Did you po/mo files in the CHILD_DIR . '/languages'
directory? Did you name your files with only the locale (example fr_FR.mo or de_DE.mo)?
You can check if the problem comes from Polylang or from your child theme by de-activating Polylang and adding the line:
define('WPLANG', 'fr_FR');
in wp-config.php (replace ‘fr_FR’ by your own locale(s) )
yup, the .mo files were not saved with the proper names. thank you for the push in the right direction. -Rich