Tag Info

New answers tagged

0

I'm not sure how you're planning to deal with these terms, but I think you can still use WPML native way to handle terms translations, even though you can't keep the same slug. When you need to deal with a term slug, you can rely on the icl_object_id() function. For instance, suppose you have English as default language, and Italian as a second language. ...


1

I'd use printf to put the markup into place after the translation. You can force the order with the right modifiers, but translators are probably smart enough to not really need that. printf( __('The image %sMUST%s be less than %s500 KB%s in size.', CUSTOM_TEXT_DOMAIN), '<em>', '</em>', '<strong>', '</strong>' ) ; I consider ...


0

Have you tried to add/change language flag in wp-config.php file define ('WPLANG', 'en_GB'); REF: Installing WordPress in Your Language


1

First of all, mind your language please. If there are swear words in your code, please remove it before you post your code. OK, to get to your question, there is nothing wrong with your code. It looks sound. Which parent theme are you using? I have a child theme which is not localized You should have a look at how your strings are localized. You ...


2

The problem I was encountering was a result of not realizing that the 3rd parameter for load_plugin_textdomain should be a relative path to the language directory from WP_PLUGIN_DIR. Since plugin_dir_path returns an absolute path, things broke. Changing the hooked function as follows solved the problem: add_action('plugins_loaded', array('PluginName', ...


0

Dan, why don't you move your function outside of your class and just register your language file normally. I would try something like this function loadTextDomain() { load_plugin_textdomain( 'plugin-domain', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); } add_action( 'after_setup_theme', 'loadTextDomain' ); Apart from this, ...


1

Yes the update included the proper files for the new language I selected. All I did was switch the language variable in wp-config.php, then updated when the option appeared ;) As far as I remember, that’s how it happened.


1

I've run into this lately. I saw that update to French version after I had just added fr_FR in the wp_lang variable of wp-config.pho. No need to go get the files, just click update :)


1

No, it is not. Use esc_html__( 'string', 'text_domain' ) instead (two underscores). Translated strings are unknown input. Unknown input is per default malicious. You don’t know where the language file comes from. It doesn’t even have to be the one you provided, because the path can be filtered. Even if it is your file: do you have control over the whole ...



Top 50 recent answers are included