0

I recently asked a question about l18n for WordPress terms like "Taxonomy", "Plugin", "Custom Post Type", etc. I was wanting to get some input on whether to translate these terms or not. Scribu made a great point suggesting that WordPress translates them and therefore, they should be translated in plugins. Also, he made a great suggestion that I could use the WordPress translations if I do not assign these terms a new textdomain.

My new question is, how would this be best implemented. For instance, imagine I had an text input and I wanted to label it with "Taxonomy Name". Would it make sense to do the following:

<label><?php echo __('Taxonomy') . ' ' . _x('Name', 'text input label', 'my_plugin_domain'); ?></label>

This looks hideous, but I would be able to take advantage of WordPress' l18n. Also, I'm uncertain of this method because it does not take advantage of argument swapping with printf. I'm not sure if you can mix the WordPress and custom l18n within argument swapping.

Any advice on how to go about handle this?

2

Only use the internal translations if you use the complete string without any addition. Grammar rules, writing directions etc may be different in your user’s language and your order may not match their needs.

You example would be Taxonomiename or Name der Taxonomie in German. How should a translator handle this?

So, use:

<?php echo _x('Taxonomy Name', 'text input label', 'my_plugin_domain'); ?>
1
  • You've successfully dashed my fantasies of having WordPress handle some of the translation work. Thanks for the answer!
    – tollmanz
    Jul 12 '11 at 1:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.