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)

9
votes
3answers
594 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 ...
8
votes
5answers
12k 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 ...
8
votes
3answers
538 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
231 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 ...
7
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 ...
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
5k 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
197 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
2answers
87 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 ...
6
votes
1answer
192 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
186 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
5k 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
787 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
2k 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
337 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 ...
4
votes
5answers
1k views

How to create .pot files with POedit?

I've spent hours today on what seemed like something really simple, which is to create a .pot file for a Wordpress theme that I'm creating. I've read the Smashing Magazine article, the Tutsplus ...
4
votes
2answers
96 views

How to make a text with hyperlink translatable in WordPress?

I've seen different ways of doing making a text with a hyperlink translatable. However, I have been unable to find a single best practice. So, some of the solutions I found: // METHOD 1 sprintf( __( ...
4
votes
1answer
98 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
819 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
3answers
865 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
1answer
219 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
187 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
176 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
948 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
208 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
67 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
309 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
516 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 ...
2
votes
2answers
96 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
197 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
1answer
38 views

How to detect if text domain is already loaded?

Without going into a lot of details, I have a multiple custom plugins within a multisite that share files outside of its original plugin folders. These plugins all work in conjunction with each other ...
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
1answer
49 views

The effect of x() family of functions

So I know that _x() and it's wrappers allow a developer to specify the context of a translated string. I'm pretty clear on "how" to use this function as well as "why" it should be used. I am wondering ...
2
votes
2answers
351 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
338 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
47 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
502 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
426 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
80 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
108 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
192 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
1k 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
4k 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
468 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
3k 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
122 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
80 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 ...