Strings in class not being translated. (All other strings are.)
-
I have been handed an existing WP plugin for translation. I am using the WP __() function, which works fine in all cases, except for the following. (This is the relevant part of the code, of course, not all of it.)
class Co_product_configurator_Public { private $ins_banister_right; private $ins_banister_left; private $ins_none; public function __construct( $plugin_name, $version ) { $this->ins_banister_right = __( "Rampe d'escalier à droite", 'co_product_configurator'); $this->ins_banister_left = __( "Rampe d'escalier à gauche", 'co_product_configurator'); $this->ins_none = __( 'Aucun', 'co_product_configurator'); } public function copc_get_banister_product_by_height( $height = ''){ $select_html .= '<div class="copc_banister_field"><label>'. $this->ins_banister_left .'</label><select name="copc_banister_left">'; $select_html .= '<option value="">'. $this->ins_none .'</option>'; $select_html .= '<div class="copc_banister_field"><label>'. $this->ins_banister_right .'</label><select name="copc_banister_right">'; $select_html .= '<option value="">'. $this->ins_none .'</option>'; } }
My .po file contains: (line numbers are accurate)
#: public/class-co_product_configurator-public.php:64 msgid "Rampe d'escalier à droite" msgstr "Trapleuning rechts" #: public/class-co_product_configurator-public.php:65 msgid "Rampe d'escalier à gauche" msgstr "Trapleuning links" #: public/class-co_product_configurator-public.php:66 msgid "Aucun" msgstr "Geen"
Problem is, the original French strings are showing up, (msgid) not the translated variants (msgstr).
My .po file is functioning, as strings anywhere else in the plugin are correctly translated.
Any help would be appreciated!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Strings in class not being translated. (All other strings are.)’ is closed to new replies.