Possibility to use WordPress built-in localization

It is possible, and in some cases make sense, but I would advice against thinking that way. Some words in the context of wordpress core admin might be translated differently in the context of a theme. If the motivation here is to save translation time, then don’t bother as any one with translation experience will … Read more

Strings including html for localisation

Your example is correct, simply because it works. There are hundreds of ways to localize strings wich are displayed including html, all good and elegant in their own way. I like to do this as follows: printf( ‘<div class=”updated”> <p>%1$s</p> </div>’, __( ‘All options are restored successfully.’, ‘mytextdomain’ ) ); You also could do this … Read more

Change WordPress Language

I found the issue. So what happens is that when you do redownload the wordpress you need to go BACK into settings and update the language setting in the dropdown. It will have a new value there. 🙂

Do I need the .po file for my plugin?

keep the .po. If someone will want to modify your translation he can do it based on your .po but it is much harder to do it (if possible at all) based on the .mo file. You don’t save much by not distributing the .po and it keeps things organized for you as well.

get_locale() behaving strange in same functions.php file

You try this example <?php // outputs a list of languages names ?> <ul><?php pll_the_languages(); ?></ul> <?php // outputs a flags list (without languages names) ?> <ul><?php pll_the_languages(array(‘show_flags’=>1,’show_names’=>0)); ?></ul> <?php // outputs a dropdown list of languages names ?> <?php pll_the_languages(array(‘dropdown’=>1)); ?>

How to translate multi-line strings?

__() 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