The tag has no wiki summary.

learn more… | top users | synonyms (1)

15
votes
3answers
4k views

Change language by clicking a button

The goal is to offer a button/select drop-down or similar to switch the public interface1) language on the fly. What I'm searching for Plugin or Theme Code... ... or Ideas Using a work-around with ...
10
votes
2answers
1k views

pass object/JSON to wp_localize_script

I've got a working piece of javascript that contains an object literal. But I need to localize it, and I'm ytrying to figure out how to rewrite it so that I can get wp_localize_script() to accet it, ...
9
votes
5answers
4k views

Change the text on the Publish button

Is there a way to change the text of the publish button on a custom post type to say some different? For example, Save instead of Publish. And also remove the draft button?
8
votes
2answers
446 views

How to get a localized version of WordPress from a repository?

I'm setting up my basic skeleton / boilerplate I want to use for all wordpress projects. I follow Mark Jaquiths approach and include WP as a submodule. He gets it from ...
7
votes
1answer
3k views

What is a Theme textdomain?

I've found that any WordPress theme uses this functions, but I don't understand what is the purpose of it and what is it, in this case 'themify'? Here are some examples in Themify functions.php: 1). ...
7
votes
1answer
873 views

How to integrate get_post_time with date_i18n function?

I have date format and would like to translate to another language with date_i18n function how can I integrate with get_post_time here is my code : $time = get_post_time('F j, Y', ...
6
votes
5answers
7k views

How to translate a plugin via .po .mo?

I want to translate this plugin. This plugin already has translations to some languages, and it has .pot file for adding new languages (as far as I understood from description). Although I never had ...
6
votes
2answers
835 views

Do Child-Themes automatically load the Translation from the Parent-Theme?

Is it enough to just create a child-theme - let's say technically without adding anything else but the bare minimum style.css - to have the translation of the parent-theme being used automatically for ...
6
votes
1answer
177 views

Gettext details

I've got a few gettext() questions that are not covered anywhere in WordPress Codex but I think they are important. __('string') in THEME should be used for strings that are likely to be present ...
5
votes
1answer
3k views

How to make a WordPress plugin translation ready?

What is the best way create a plugin that is translation ready? It doesn't have to be translated from the beginning but it has to be easily translatable so fellow developers from different cultures ...
5
votes
4answers
4k views

Theme localization of “slugs” (custom post types, taxonomies)

in my theme I want to define a series of custom post types and custom taxonomies, each one having its own customized slug; the base language of my theme is english, therefore the slugs will be in ...
5
votes
1answer
1k views

Setting WPLANG from a plugin

For a single site wordpress, the language must be set from wp-config.php's WPLANG, but is it possible to set from my plugin which override the default value?
5
votes
1answer
8k views

Translate widget titles using qTranslate plugin

I'm actually using the qTranslate plugin to translate my website. It works really well with everything except one thing. the titles of my sidebar widgets. Actually, to translate some words we need to ...
5
votes
2answers
3k views

How-to: Translate plural forms for themes/plugins with PoEdit

As the title says: How would you translate... _n() _n_noop() _nc() _nx() _nx_noop() ...in your .mo files?
5
votes
2answers
1k views

How to provide translations for a WordPress TinyMCE plugin?

I know that I can get my translations into JavaScript doing: $MyTranslations = array( 'translation1' => __("Some String 1", "MyTranslations"), 'translation2' => __("Some ...
5
votes
3answers
3k views

Open Source replacement for WPML?

Since WPML is not free anymore and still one of the most used Wordpress Translation Plugins, is there an open source project that keeps development going? Or something similar that replaces it? I ...
5
votes
3answers
556 views

Localization: I want the backend: english and frontend in defined language

I'd like to have the backend of Wordpress in English and use a different locale for the frontend so far I figure out perhaps I could do it by setting in the wpconfig the locale I want to use in the ...
5
votes
1answer
110 views

How to auto-translate custom user roles?

I developed a small plugin that adds (or to be more precise: first deletes then adds again) some custom user roles. Each of these roles is set up in a way like this: function ...
4
votes
2answers
765 views

HTML inside __() or _e() language translation string

What is the proper approach to building translation strings? For example, echo __( 'Hello ' . $first . ' you owe me money.' ); echo __( '<div><p>Top: ' . $t_margin . '</p>' . ...
4
votes
1answer
142 views

Obtain a list of available translations

In answering this question: Change language by clicking a button. It was necessary to obtain a list of languages for which translations were available (i.e. their po/mo files were present in ...
4
votes
1answer
276 views

How do I translate: “2 hours and 15 minutes”?

I want to translate the generic phrase "x hours and y mintues". Of course, if it's only one hour, it should say "1 hour and y mintutes". The same goes for minutes, "x hours and 1 minute." I know ...
4
votes
3answers
421 views

Best pratice to make taxonomy terms translatable without changing slugs?

I have one custom taxonomy with countries and states. I'd like to make these terms translatable but I'm not sure what would be the best way to achieve this. First of all, I don't want the slugs to ...
3
votes
2answers
264 views

How to concatenate inside the _e() function the right way?

I'm trying to create a function for the title inside my functions.php, I'm having a problem with the search title part where I have to concatenate here's the part with issues: elseif (is_search()) { ...
3
votes
2answers
256 views

How to prevent text modified using gettext filter being stomped (presumably) by updateText() js function within a CPT's edit screen

First a teeny bit of background... I have a custom post type where I'd like to use custom post statuses. Since custom post statuses (stati/status/whatever), have not been fully implemented within the ...
3
votes
1answer
165 views

What is the purpose of an extra file for translation?

What code is required to put in functions.php in order to make the theme translation ready? The TwentyEleven theme has only following line: load_theme_textdomain( 'twentyeleven', ...
3
votes
2answers
340 views

What is the purpose of adding a .po file?

I added the below code to the function.php of a .po file and finished localization and edited the webconfig.php to add Arabic language but nothing happened. I want to know what should happen. Will the ...
3
votes
3answers
2k views

Titles in my sidebar widget appear in all languages - with qtranslate

So here's my code, using the qTranslate plugin: query_posts(array('post_type' => 'uk_blog', 'numberposts' => 2)); $i = 0; while(have_posts()): the_post($post);?> <div ...
3
votes
1answer
1k views

How to save a translation of a plugin in “CodeStyling Localization”?

Hi I was translating one of my plugins in "CodeStyling Localization". when I update my plugin my translation erased. Is there anyway to find it ? And How can I backup my translation (I don't want to ...
3
votes
1answer
414 views

what's different between _x() and _()

What's different between _x() and _(). For example: if a1 can translate as: a1 has meaning x1; a1 has meaning x2; How _x() function to get value x1 or x2?
3
votes
1answer
2k views

How to Translate Contact Form 7 using qTranslate?

I'm using Contact Form 7 for my forms and also qTranslate to translate my website. I would like to translate all my fields and for that I used: <!--:en-->First Name ...
3
votes
1answer
3k views

[Plugin WPML] : How to create a translation of a post using the WPML API?

I'm trying to figure out how to create a translation for a post using the internal WPML API (inc/wpml-api.php) I simply want to create a translation for post ID xx, set some content and publish it. ...
3
votes
1answer
460 views

Overwrite textdomain of plugins by default - Lost Translation

Wordpress is awesome, but there is something that is driving me crazy. Whenever a plugin or a theme is updated, all files are deleted and replaced. So if I have custom code or a translation in one ...
2
votes
2answers
263 views

List of Default Translated Phrases

With <?php _e('Save Changes') ?>, I know the phrase, "Save Changes" can be translated automatically if the user's locale is set to a different language. I'd like to know if there is a list of ...
2
votes
2answers
4k views

Help with “text domain”, comments_form in WordPress theme

I've been plugging away at creating my own theme and am pretty much there, but ran the Theme Check plugin and had a few concerns/questions: Throughout the theme, wherever there is text, I've used ...
2
votes
2answers
162 views

How to use Yoast SEO backend in english even if WPLANG variable is not english?

I added this code to my functions.php file add_filter('locale', 'wpse27056_setLocale'); function wpse27056_setLocale($locale) { if ( is_admin() ) { return 'en_US'; } return ...
2
votes
3answers
479 views

Suggestions for i18n plugin

Could you please suggest me good plugins (that you have used) for translating a WordPress website? It should be wonderful if you can add as well a pros and cons list with your suggestion. Thanks in ...
2
votes
1answer
594 views

Plugin Localization

i've just built my first plugin for wp, and even if it's not a great "code poetry" ;) it works as it should. It's a plugin that transform the default wp gallery using the GalleryView 3.0 jquery plugin ...
2
votes
2answers
2k views

Best way to filter featured image text for a custom post type?

I am trying to change the "Set featured image", "Remove featured image", and "Use as featured image" text links of a custom post type for my plugin Meteor Slides. I found the ...
2
votes
2answers
91 views

Should i use _n for pronouns in translation?

I use _x() now! I accepted the answer just because he understood right and was first. So don't get confused! $like_me_on = __('Like me on %s', 'my-plugin'); $like_us_on = __('Like us on %s', ...
2
votes
1answer
747 views

generating po mo translating files from scratch in a wordpress theme

Maybe I'm missing something here but I really can't find any answer to my question around the web. I am creating a new wordpress theme from scratch (literally from scratch) and would like to create ...
2
votes
1answer
51 views

Make changes to translation?

I'm using finnish translation of wordpress. I found the fi.po file which contains all the translations, but for some reason, editing the contents wont edit the contents of the page. Can I make ...
2
votes
1answer
263 views

How do translated, escaped strings (esc_attr) in Themes work?

I was looking at the TwentyEleven code and found this: esc_attr__( 'Permalink to %s', 'twentyeleven' ) This is come code that came out of the title tag for a post; the full code within the title ...
2
votes
1answer
1k views

Translate Navigation Menu & Sidebar Widget Titles

Is there any plugin to translate navigation menu & sidebar widget titles ?
2
votes
1answer
26 views

How to extract translatable (double underscores and _e) strings?

I made a custom theme and wonder how could I extract all translatable strings to a .po file so I can translate it. Do I need WPML plugin? Ex: I have a string "soccer" which is written as ...
2
votes
1answer
50 views

Where the WordPress Core Translation is “actually” taking place?

I'm a WordPress Core Bengali translator, currently translating and/or fixing existing translations of WordPress 3.8x Bengali in Translate.WordPress.org. Suddenly, yesterday I got an update ...
2
votes
2answers
184 views

Working with l10n contexts (_x etc)

Basic l10n from a .mo file generated out of PoEdit works fine. But as soon as I introduce _x, or variants, the link breaks, because as best as I can tell, PoEdit, completely ignores the context, and ...
2
votes
1answer
93 views

Making a configurable field translatable

I'm working on a theme right now that gives the admin the possibility to set different texts that are used within the theme, by configuring them in the admin panel (e.g. the text that is displayed, ...
2
votes
1answer
555 views

How to use get_option() without any filter?

I'm using the newest WordPress 3.3.1 and newest qTranslate 2.5.27. I have made some an AJAX script which returns a value and message in the current language. Here I get my first problem, I solve it ...
2
votes
1answer
313 views

Adding another arg to comments_popup_link

what WordPress core functions do I have to modify to change comments_popup_link('Ni komentarjev', '1 komentar','% komentarjev') to comments_popup_link('Ni komentarjev', '1 komentar', **'2 ...
2
votes
2answers
46 views

Translation-readiness of Koi theme

I am migrating a (non-English-language) blog using the Koi theme on WordPress.com to a self-hosted environment, but see that certain strings are no longer being translated. For example, if my ...