Tag Info

New answers tagged

1

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 af_AF.mo I'm not sure what the codes are for German, but change the ...


1

After looking at the l10n.php I found a way to switch the textdomain using the unload_textdomain function. So I created a simple switch function switch_textdomain( $domain, $newLocale){ /* This will only change the textdomain, not the locale. It will only affect what kind of language will be used for the _e(), _(), __() commands for the $domain ...


1

No you can't this way. See documentation : $echo = text_function(); printf( __( 'My string is %s', 'my-text-domain' ), $echo );


0

You can do this with the WordPress tools, without POEdit. First, do an svn checkout of http://develop.svn.wordpress.org/trunk/: svn co http://develop.svn.wordpress.org/trunk/ wpdev Then, switch to the i18n tools directory in it: cd wpdev/tools/i18n/ Then just run the makepot.php over your theme's directory: php makepot.php wp-theme /path/to/your/theme ...


3

Here is how you can create a .pot file for your theme with Poedit (free edition, version 1.6.10) on OS X. Best practise is to save language files in a folder named "languages" in your theme directory. If you haven't already, create it before you start. In Poedit: In the "File" menu select "New" Select the language that you used in your theme (probably ...



Top 50 recent answers are included