On Thu, 21 Sep 2006 10:52:32 +0200, "Lukáš Kucharczyk"
<[EMAIL PROTECTED]> wrote:

>Thanks a lot for explanation. One last question: What's that with the
>'textdomain_if_apply' thing?

If you use the sintax of your example for theme and plugin gettext
will search translation in the ,mo file of WP, if you specify at the
start of your theme/plugin

load_plugin_textdomain('plugin/theme_name_domain',[$path =
'path_to_plugin/theme_dir'])

and you will use the text_domain in the __ and _e fuctions the
translation will be searched in the specified textdomain file

Example

You have a plugin named FancyPlugin, that's in a subfolder in the
plugin directory (named fancyplugin) you will have a line:

load_plugin_textdomain('FancyPlugin',$path =
'wp-content/plugins/fancyplugin')

all the __() and _e() function will have the format:

__('text to translate', 'FancyPlugin')

This way the gettext will search the translation in

FancyPlugin-xx_XX.mo files where xx_XX is the language code (ex: it_IT
for italian)

Sarch on the codex for info and example about translating plugins and
theme

-- 

Stefano Aglietti - StallonIt on IRCnet - ICQ#: 2078431
Email: [EMAIL PROTECTED] [EMAIL PROTECTED]
Sites: http://www.40annibuttati.it (personal blog)
       http://www.wordpress-it.it (WordPress Italia)
_______________________________________________
wp-polyglots mailing list
[email protected]
http://lists.automattic.com/mailman/listinfo/wp-polyglots

Reply via email to