Localization (commonly abbreviated as l10n) is a term used to describe the effort to make WordPress (and other such projects) available in languages other than English, for people from different locales, who use different dialects and local preferences.

learn more… | top users | synonyms (2)

8
votes
3answers
505 views

What's the point on gettext syntax?

So far I've been handling some translations in Wordpress and tried to read the official gettext documentation but won't get the point of one maybe simple thing: What's the differences between those ...
8
votes
2answers
206 views

Translate a string to a language with masculin/feminine nouns

So in english we don't have gendered nouns. It is always "a table" or "a desk" with no need to worry about it being "une table" or "un tableau" (french). So my question is that when working on the ...
8
votes
3answers
511 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
5answers
9k 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 ...
7
votes
1answer
1k 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', ...
7
votes
1answer
4k views

How does printf( __( ) ); work?

Today I work through a theme to get a better understanding of WordPress and templating. I discovered this: <?php printf( __('Designed by %s', 'Anyword'), '<a ...
6
votes
2answers
183 views

Can I leave off plugin textdomain for terms used in core?

I've got a plugin that puts post statuses into post type admin menus. I'm in the middle of internationalizing it, and I'm wondering how to handle this situation. The plugin uses some unique strings ...
6
votes
1answer
184 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
4k 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
1answer
182 views

What is meant by __('page','twentytwelve')

I'm using twentytwelve theme with 1.0 version. I saw many codes like following, 'name' = __('page','twentytwelve'); If I give, 'name' = 'page'; It's also working fine. Then why using __()? What ...
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
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
627 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 ...
4
votes
3answers
1k views

Can we load “load_theme_textdomain” multiple times with different domains?

Supposing that I have two domains in my theme named "basic" and "advance". Is it possible to load two different domains in my theme? load_theme_textdomain( 'basic', TEMPLATEPATH.'/languages' ); ...
4
votes
1answer
89 views

How to i18n slugs for templates?

some templates are chosen from WordPress based on slugs (e.g. category-{slug}.php). Problem: How can I use the same template for an i18n'ed slug? Example: I have a category-news.php and an english ...
4
votes
3answers
521 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 ...
4
votes
3answers
688 views

Running WP Cron on specific local time

The scenario is to run insert_post function every midnight (00:00) of local time. Must run daily on weekday. function add_daily_task(){ if((date('l', time()) != 'Saturday') || (date('l', time()) ...
4
votes
1answer
206 views

Using plural-only translation of register_post_status() in plugin

tl;dr: My plugin wants to translate strings from core or other plugins that use _n_noop(). How? This question related to this plugin and is sort of a follow up to this question. My plugin adds ...
4
votes
1answer
165 views

localize inline css

I'm providing a theme setting to define a group of images for the frontpage background. On page load, I want to pick an image at random from this pool. My approach is to add a line of inline CSS ...
3
votes
1answer
212 views

Enqueue Stylesheets After Theme's “rtl.css”

I am currently developing a theme with internationalization support, and would like to load stylesheets after my theme's rtl.css (an alternative style.css loaded for languages with a right-to-left ...
3
votes
1answer
169 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
871 views

Localizing text from XML files

Do you guys know any way I could automatically pick up strings from .xml files and store them in a .po / .pot file, just like PoEdit does with the ones from .php files? The XML structure looks like ...
3
votes
2answers
206 views

Localizing strings that come from outside of plugin?

Plugin queries remote API and under certain circumstances (mostly errors) displays textual messages from API responses. All messages in API responses are in English, but since they are more or less ...
3
votes
1answer
36 views

Translate third party plugin and save translation files in custom theme

I'm using Codestyling Localization and I want to translate a plugin and I want the translation files to be saved in the translation directory in the theme I'm building and not in the plugins ...
3
votes
2answers
274 views

Localized WordPress is much slower?

I'm using xdebug and webgrind to profile my WordPress installation because it's a bit slow. As there are some 20 plugins activated, I figured xdebug will be able to find the bottleneck. However, to ...
3
votes
1answer
477 views

Preparing a string in an array for localization

I'm working on a WordPress plugin and want to make sure that all text that is displayed is prepared for localization. I'm having trouble localizing the text that resides inside an array. For ...
3
votes
2answers
66 views

After updating WP keeps nagging about a newer version. Why?

I updated WP to version 3.9.2 (currently the latest) via Git which works fine. However, in the admin it keeps on telling me “a newer version is available”. After some digging somehow it appears to be ...
2
votes
2answers
92 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
176 views

Use a language specific thousand separator

I have a views counter on each post. When it reaches for example 1000, it adds a dot as the thousand separator, the result is 1.000. This is odd in my language, I should have a space as separator or ...
2
votes
3answers
2k views

add spans and characters into paginate_links

I am using paginate_links on my custom page query. What I have already works sweet and this is the code I have so far... <?php global $wp_query; $big = 999999999; // need an unlikely ...
2
votes
3answers
4k views

Wordpress multisite,one theme,and different languages?

I'm not sure is this possible,for example I have english,french and italian blog,they all use same theme,I just want when visitor is on french site for example to display date,(some strings like ...
2
votes
2answers
243 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
322 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
1answer
30 views

Localized WordPress content for different sub-locales of same language?

I have a site which serves Ireland & England. I want to move it to Wordpress. Currently all the content is the same when you visit the site & it runs off two urls, the Irish one: mysite.ie ...
2
votes
0answers
292 views

get_locale() behaving strange in same functions.php file

I'm developing a multi-language web portal for my client - in English and Bengali. Instead of using multisite, I installed Polylang plugin. It's working fine through the website. For different CSS ...
2
votes
0answers
18 views

Plugin translations files outside plugin directory? [duplicate]

I'm using the excellent Codestyling Localization plugin to translate themes and plugins. But there's a problem when translating plugins, namely that the translated strings are saved to ...
2
votes
2answers
382 views

WordPress 3.8 keeps asking me to upgrade to 3.8

It began with version 3.7.1: You are using WordPress 3.7.1. Update to 3.7.1 I've installed and usually update WP with git from https://github.com/wordpress/wordpress: cd wordpress git fetch ...
2
votes
0answers
79 views

Singular name Plugin localization

I'm trying to localize the singular name of a custom post type. ... 'singular_name' => __('key', 'plugindomain') ... I created a .po and compiled it as .mo. I also loaded the translation using ...
1
vote
2answers
107 views

Two language versions for each article

I have a Wordpress website that needs to be available in two different languages. We have the articles written in both languages already. I've seen a lot of solutions providing automatic ...
1
vote
4answers
114 views

Localizing a string with html tag with word inside that tag

I have translated many string successfully previously, but this one gives me a headache. This part is used inside my content-related.php file which I use to display related posts Here is the current ...
1
vote
3answers
958 views

Find proper “text domain” within theme

I have a client with a wordpress theme, Nevada, and we are having trouble making the built in translations work for it. The theme contains .mo files for English, German, and Slovenian, and appear to ...
1
vote
2answers
3k views

Change locale at runtime?

I wonder, is there a way to change the locale at runtime using WordPress ? What I mean, is, I have create a custom URL in order to create an XML file with data for integration with another web ...
1
vote
1answer
411 views

_n() Single and Plural for search results?

This code produces Search Results for "hello" - 1 articles " <h3>Search Results for <?php echo'"'?> <?php /* Search Count */ $allsearch = &new ...
1
vote
5answers
2k views

Proper way to create / manage gettext (.po, .pot) files?

So I'm trying to figure out how .po and .pot files work, seeing as this is what Wordpress seems to use. But I can't wrap my head around it. I get that a .pot file is a template file that indicates ...
1
vote
2answers
105 views

How to i18n text coming from the db or from an external source

I'm writing a plugin and i wanted to i18n correctly text which i'm storing in the db or in an external file. How should i do that?As of now we are generating pot files with wordpress and so all the ...
1
vote
1answer
79 views

Localiztion in javascript

Wordpress currently uses the gettext feature which is available in php but unfortunately not in Javascript. I have searched this matter on the web and have come up with this trick. But there is a ...
1
vote
2answers
52 views

Making my plugin translation ready. Poedit not working

I'm building a plug-in which is going great so far. I want to start making it localization ready. I don't know what is going wrong, but it's bugging out on me when I try to load it in Poedit. So ...
1
vote
3answers
195 views

Possible to add a language file to a plugin without adding .po/.mo files to plugin directory?

I need to add a language file to an existing plugin. Not for translation reasons, but because I'd like to change all occurrences of a certain word to something else. While I could just drop another ...
1
vote
1answer
70 views

Multisite Network Localisation

The problem seems easy to solve - I have installed multisite network, each new page have Polish language set as default, polish localisation files are in right directory, in wp_config there is line: ...
1
vote
1answer
179 views

Strings including html for localisation

How to localise this string (including html) ? echo "<div class='updated'><p>All options are restored successfully.</p></div>" ; Is this correct? echo '<div ...