Questions tagged [l10n]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
83 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?
Amirition's user avatar
  • 345
0 votes
1 answer
59 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 ...
Luca Reghellin's user avatar
0 votes
1 answer
332 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 ...
MikeiLL's user avatar
  • 569
1 vote
0 answers
18 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 ...
Ivan Montilla Miralles's user avatar
0 votes
2 answers
129 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 ...
Luca Reghellin's user avatar
12 votes
3 answers
7k views

How to get a translated 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 ...
Luca Reghellin's user avatar
0 votes
1 answer
367 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 ...
Leo240's user avatar
  • 101
0 votes
1 answer
387 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 ...
Mark's user avatar
  • 165
1 vote
1 answer
181 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? ...
unfulvio's user avatar
  • 1,814
0 votes
1 answer
114 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 : ...
Jamel Zarga's user avatar
5 votes
1 answer
362 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 ...
luke's user avatar
  • 533
-1 votes
2 answers
4k 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/...
Javacadabra's user avatar
2 votes
1 answer
385 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 &...
HiSpec's user avatar
  • 23
8 votes
2 answers
4k 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 ...
Tom Auger's user avatar
  • 7,046
0 votes
1 answer
578 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('...
Andrea Sciamanna's user avatar
0 votes
1 answer
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 ...
Raptor's user avatar
  • 272
2 votes
2 answers
533 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 ...
Scorchio's user avatar
  • 121
5 votes
1 answer
418 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 ...
Paul's user avatar
  • 2,150
3 votes
0 answers
168 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 ...
Donovan's user avatar
  • 223
1 vote
1 answer
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 ...
Zhao Li's user avatar
  • 113
5 votes
1 answer
422 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 ...
Matt's user avatar
  • 465
0 votes
1 answer
178 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 ...
PapaFreud's user avatar
  • 133
0 votes
1 answer
244 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....
PapaFreud's user avatar
  • 133
3 votes
1 answer
116 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, ...
Andrej's user avatar
  • 33
2 votes
1 answer
795 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 ...
bluantinoo's user avatar
3 votes
2 answers
315 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 ...
Rarst's user avatar
  • 99.7k