Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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'); ?>
share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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