Translate Navigation Menu & Sidebar Widget Titles
Anyway, I found my answer. I used qTranslate to translate menu wordings as well as widget titles. Free & useful.
Anyway, I found my answer. I used qTranslate to translate menu wordings as well as widget titles. Free & useful.
What I have seen in translation plugins (qTranslate, WPML, Multilingual Press) are two approaches. One is qTranslate’s (and the defunct xLanguage): use one field (one for title, other for content, etc) to hold all translations. And then, in the front end, decode its output according to the actual language. <!–en–>English<–:–><!–es–>Español<–:–> In the back end, the … Read more
You shouldn’t be using a constant (in your case CORE_THEME_NAME) for the textdomain. This is because the call to __ is parsing your code, not running it. Simply said: it’s not looking up the value of the constant. So, it won’t translate. Quoting the famous Otto: Inside all translation functions, no PHP variables are allowed … Read more
From the source code of load_plugin_textdomain it becomes appararent that the function will first look for $domain . ‘-‘ . $locale . ‘.mo’ (so, that’s myplugin-fr_FR.mo) in WP_LANG_DIR . ‘/plugins/’ . $mofile. Only when the file is not there, it will start looking at the specified path and if it is not there in the … Read more
(this kind of issues is part of why my standard recommendation is to not have front end with two languages) The core reason to the problem is that your ajax returns text. AJAX should be treated like API which provide machine level values which the front end translate to human text. When your code is … Read more
What I normally do when using this combination of plugins is to create one form per language. Easy and effective. You could also try qTranslate quicktags: [:en]English text[:ru]Фамилия. But much probably this will lead to some issues down the road.
The twentyseventeen_edit_link() function returns an accessibility-friendly link to edit a post or page. Here is its content: function twentyseventeen_edit_link() { $link = edit_post_link( sprintf( /* translators: %s: Name of current post */ __( ‘Edit<span class=”screen-reader-text”> “%s”</span>’, ‘twentyseventeen’ ), get_the_title() ), ‘<span class=”edit-link”>’, ‘</span>’ ); return $link; } Since it doesn’t provide a hook or filter, … Read more
One way is to use the WordPress i18n tools. I had to checkout WordPress trunk to make it work. On the command line: svn co http://develop.svn.wordpress.org/trunk once you have trunk somewhere, you’ll then want to call the makepot script. Again, on the command line: php /path/to/wordpress/trunk/tools/i18n/makepot.php wp-theme /path/to/your/theme/ After that script has run, the pot … Read more
__() “Retrieves the translated string from the translate() function” without echoing. _e() does the same thing but echos the output. For more information, take a look at these help articles: Internationalization Localization How to Internationalize Your Plugin Internationalization Security
Load translation files as late as possible for your plugin’s use-case. This allows other plugins as much time as possible to fully initialise. Why should you care about other plugins? Because they may be involved in the localisation process too. For example, changing the site language or filtering translation file paths. They can’t do those … Read more