Custom values are not translated
Custom values are not translated
Custom values are not translated
I have no words 🤦♂️ A simple change dirname(plugin_basename(__FILE__)) . ‘/languages/’ inside wp_set_script_translations() function (3rd argument) to plugin_dir_path(__FILE__) . ‘languages/’ fixed the problem
Translations for readmes on .org are done through https://translate.wordpress.org. You could contribute translations for your own plugin if you wanted. Start by picking a locale/language you want to translate into, search for your plugin, and select the Readme Sub Project. You don’t need to do anything special to the readme itself.
Since you have already figured out what the text domain is – the last parameter of __() – I want to add something most people forget when custom post types or taxonomies are made translatable: slugs. Your post type or taxonomy name can mean something very different or even embarrassing in another language. Or it … Read more
Own theme If you are using your own theme, no need to worry about, because /languages folder is in your control that way. 🙂 Other’s theme But your concern is about other’s theme and you want to apply your translations into that theme, then the best way is to make a Child Theme. Because you … Read more
When naming your po and mo files in a theme, you need to only make use of the language code to name these files. Any other convention will not work For example, my blog is in Afrikaans and the localization language code is af_AF. My mo and po files are named accordingly, ie, af_AF.po and … Read more
Yes, rename your pt_AR.mo to ar.mo and pt_FR to fr_FR.mo. In step one install but not activate yet the plugin Admin in English. Edit the plugin’s php script. Find line with en_US string and replace this string with fr_FR. Save and activate the plugin. Now your Dashboard will be in French. In step two remove … Read more
The easiest approach would be to have custom fields on the edit page: one text field for every language you want to use (and perhaps different title fields?) For this you could use a plugin like ACF. This would provide an easy interface for non-tech editors. Supposing you are building your own theme you can … Read more
I figured it out almost immediately after asking the question, after months of frustration. The issue was I was using the load_textdomain function (which was the way I learned it) instead of the apparently newer/favored load_plugin_textdomain. The working code looks like this function rsvpmaker_load_plugin_textdomain() { load_plugin_textdomain( ‘rsvpmaker’, FALSE, basename( dirname( __FILE__ ) ) . ‘/translations/’ … Read more
1) Presuming you’re running WordPress 4.x. The WPLANG constant does nothing. WordPress 3 and below defined the default language in wp-config.php but since WordPress 4 setting your site language is done via the General Settings page in your admin area. Go to Settings > General and scroll to the bottom where is says “Site Language” … Read more