Can I use the same textdomain in two separate plugins?
In simple words “NO” it is not recommended until one plugin is not a subset of another plugin. If you want multi-language use different. Thanks, Vee
In simple words “NO” it is not recommended until one plugin is not a subset of another plugin. If you want multi-language use different. Thanks, Vee
How does WordPress choose which translation file to use?
You can ship translations of some of the metadata used in your main plugin file’s header comment fields. Namely: Name, Description, PluginURI, Author, and AuthorURI. Just add the source strings into your PO/POT files exactly as they appear in your plugin headers. When a MO file is available containing these strings, WordPress will display the … Read more
Filter ‘comments_number’. You get the translated number and the real number as arguments. Return what fits best. Sample code: add_filter( ‘comments_number’, ‘wpse_31328_comments_number_i18n’, 10, 2 ); function wpse_31328_comments_number_i18n( $text, $number ) { if ( 2 === $number ) { return _x( ‘2 comments’, ‘comments number’, ‘your_text_domain’ ); // or hard coded: // return ‘2 komentarja’; } … Read more
__() and the other l18n functions will handle any string you give them, including line breaks. In my experience, poEdit recognizes them just fine, but if you’re having issues, you may consider using UNIX line break escapes \n instead of actual line breaks inside the strings; in this case, be sure to use double quotes, … Read more
Don’t use the update now button, use a full on download of the core WP – http://wordpress.org/download/ – and then make sure you flush any cache you’ve got running. Do you have memcached or APC or xcache? Purge that. Plugins ditto. I saw that on one of my sites where my server’s object cache hung … Read more
I’m not 100% sure this is the only issue that was preventing POEdit from correctly parsing my code (I’m not sure it actually cares about the WordPress side of things), but fixing these (stupid) errors and re-running POEdit from the .pot file below seems to have generated the correct translation strings: define( ‘MY_TEXTDOMAIN’, ‘MY_TEXTDOMAIN’ ); … Read more
When using other translation tools (other then poedit) like GlotPress you can see the context in which the string for translation is called upon.
See http://wpmututorials.com/how-to/localization/ Basically after you install the language packs, go to that site and change the language option from the admin area.
Best way would probably be to use the built in Internationalization function in WordPress. This will then translate according to the language pack being used. The “U” character to a date() call gives the unix timestamp, which is just what you need in this case, for passing to date_i18n(). For example: echo date_i18n(‘j F Y … Read more