Gettext details

Interesting questions, I’ll try my best, but I hope others can also give input.

re 1. Usually I use the theme’s text domain also for strings that are likely to be present in the main WordPress translation file

re 2. correct

re 3. I think it is a good idea, but I don’t know if it is bad practice or anything like that

re 4. correct

re 5. I also think it is very useful.

re 6.1. A few months ago Otto did a post on the correct way of internationalising strings. For anything related to numbers he gives the following:

$string = sprintf( __('You have %d tacos', 'plugin-domain'), $number );

re 6.2. correct

re 6.3. I had to look this up and found the answer on a thread in the WordPress forum:

if (0 < $numtags) $numcats= number_format_i18n($numtags);

Keep in mind that internationalization of themes and plugins is still not widely spread, WordPress is very much US (or English) oriented and only this year it seems that people are putting more attention to it. I wrote an article on WPCandy earlier this year about the very subject.

Leave a Comment