Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [l10n]

The tag has no usage guidance.

0
votes
2answers
21 views

Localize plugin name

Plugin name is a comment in WordPress. Since you can't write php code in the comments, is there a way to localize the plugin name and make it translatable?
0
votes
1answer
15 views

How to 'manually' load translations/test domain outside theme context?

So I need to build a pdf file starting from a php/html template (currently using mpdf library). So my-pdf-template.php file will never be shown on the website frontend, and sits on the main theme's ...
0
votes
1answer
76 views

What about Deferring a localized script?

I would love to defer the loading of the script for a plugin, Simple Locator, which uses Google.maps API. However it uses wp_localize_script, which prints a wpsl_locator javascript object in the HTML ...
1
vote
0answers
14 views

Single translation for many locales

Greetings to everyone, Is it possible to do make a single translation for many locales? Let me explain it better: Can I create a single translation file for my theme called es.po and es.mo so it ...
0
votes
2answers
66 views

Is this really always bad? (variables in l10n functions)

I needed to translate strings on another language than the current $locale, so I need to change the locale and restore it later, and I really couldn't repeat all the code for the 30++ strings I had to ...
8
votes
2answers
1k views

How to get a traslated string from a language other than the current one?

I was wandering... All the translation functions (__(), _e(), _x() and so on) use the current/active language. Is there a way to get a translation from another language than the current one? For ...
0
votes
1answer
150 views

Localization of menu items

In register_nav_menu() function is possible to pass the second parameter inside wp l10n function: register_nav_menu( 'primary', __( 'Primary Menu', 'theme-slug' ) ); but how to localize the menu ...
0
votes
1answer
174 views

Localize strings from db

I'm using this method to translate strings in my template. The question is, what if some strings are dynamically loaded from the db? How can i translate them? I've been googling for days and even ...
1
vote
1answer
132 views

Using WordPress gettext functions in a library outside plugin or theme scope

If I have a library available through packagist that could be used in WordPress plugin or theme development, how should I address multilanguage support if I have a few strings that could be localized? ...
0
votes
1answer
74 views

How to get the list of languages provided by a plugin

I'm creating a new wordpress plugin dealing with the admin languages, and I'm wondering if you know how to get the list of languages provided by a specific wordpress plugin ? like this one : ...
5
votes
1answer
274 views

switch_to_blog(): Load textdomain

I am using the WordPress multisite feature with Multilingual Press Pro to create a multilingual site with linked posts. In a network activated plugin the custom post types are registered. For ...
-1
votes
2answers
3k views

PHP Warning missing Argument 1 for __()

I am getting this error in my server error logs: [Thu Dec 11 10:06:30 2014] [error] [client 11.111.111.111] PHP Warning: Missing argument 1 for __(), called in /var/www/vhosts/mysite.org/public_html/...
2
votes
1answer
268 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 &...
7
votes
2answers
3k 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 ...
0
votes
1answer
403 views

Theme doesn't want to load localization files

Here is my functions.php excerpt: function get_theme_text_domain() { //Same behavior if I return the string as 'return 'whatever' $theme = wp_get_theme(); return $theme->get('...
0
votes
1answer
2k views

How to keep a variable in COOKIE or GET query string?

I'm working on adding a language variable (locale) in my custom WordPress theme. I made the translation working by adding ?l=en_US to the URL. I would like to add the parameter into COOKIE, such that ...
2
votes
2answers
434 views

How to prepare SimplePie_Item's get_date() for l10n?

I'm trying to improve the localization of the Bones theme. On the admin side it provides an RSS widget which uses the following code: <?php echo $item->get_date('j F Y @ g:i a'); ?> This ...
5
votes
1answer
282 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 also ...
3
votes
0answers
128 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
1answer
1k views

Multisite WPLANG won't save

I have a multisite workpress install (v 3.3.2). I'm trying to save the WPLANG field but nothing happens. I get the confirmation message "Site options updated", but the field is still blank. And ...
5
votes
1answer
392 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 _n(...
0
votes
1answer
157 views

Wordpress localization - gettext and git

We're about to start working on localization of a highly customized wordpress theme with over 200 php files. We're using git for version control. Are there any particular hints or warnings we should ...
0
votes
1answer
232 views

localization of theme and plugins to English (originally in another language)

We're about to start localizing a wordpress installation with a highly customized theme and several custom plugins. Unfortunately it is not gettext-ready, and also the original theme is not in English....
3
votes
1answer
106 views

WordPress localization

In WordPress localization files (.po), does php map files by the line number eg. comments.php:60 or msgid msgid "<span class=\"meta-nav\">&larr;</span> Older Comments". So basically, ...
2
votes
1answer
699 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 ...
3
votes
2answers
252 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 ...