Stack Exchange Network

Stack Exchange network consists of 174 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

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.

0
votes
1answer
12 views

Localisation and Wordpress

So I'm setting up translations for a website based on locale. But it seems like Wordpress is determining this with the language as set in the Admin. How do I set up a localisation so that if I'm in ...
0
votes
1answer
36 views

gettext localization is not working

I'm trying to translate the post date using __() function. But it is not working. The post date still displayed in English. What are you the other options to localize the post date(posted-on). ...
0
votes
1answer
39 views

Can't translate the post meta data (Date) in another language

I want to translate the post meta data (date) in chines language for example, September 13, 2017, should be translated as 2017年9月13. But my code gives it in English. Do you see any error? Please help. ...
0
votes
1answer
24 views

WooCommerce does not translate every string

So I have an issue with WooCommerce translation to German language - basically it does not translate every single string. I'm using a child theme of "Neighborhood" theme and we have a plugin Loco ...
3
votes
2answers
27 views

Problems with localization

I'm creating a plugin and I've put: define ('WPLANG', 'it_IT'); into wp-config.php file. After plugin Name in the Header of the Plugin declaration: * Text Domain: endpoint * Domain Path: /...
0
votes
0answers
23 views

Adding language string to all URLs

I'm trying to set up some simple localisation on a site but I can't seem to get Wordpress to prepend the path with a language. I've set up some JavaScript that detects the user's language and ...
0
votes
1answer
20 views

Can't Change WooCommerce Default Language to Spanish (Mexico)

Going a bit mad here on how complicated they have managed to make changing the language in WooCommerce. My site is in Spanish (Mexico), interface admin is in Spanish.I have also managed to set ...
0
votes
1answer
33 views

Change locale by detecting viewer's browser language setting and let them choose prefered language after

I am coming from a multi-linguo country, and viewers may speak different language. I am writing a theme and I noticed that the language of my theme only changed based on the setting of my admin panel,...
1
vote
0answers
70 views

What can be reason for no plugin-strings available under stable section on translate.wordpress.org?

I cannot see any plugin-strings under the stable section on translate.wordpress.org. What can be reasons for that? P.S.: Under development section, I can see all the plugin-strings.
2
votes
1answer
26 views

What is the way to ship read-me strings like plugin-strings for internationalization?

I want to translate my plugin for non-English languages. But for readme strings, I could find the only option to submit translations over translate.wordpress.org. Is there any way like the one ...
0
votes
0answers
19 views

How to reload WPML string translations for a reloaded theme textdomain?

I have an action that changes the theme locale from the plugin in the following way (plugin/wcet/wcet.php): $locale = get_custom_locale(); add_filter( 'theme_locale', function() use ( $locale ) { ...
0
votes
1answer
30 views

.PO file is found but I don't see translations: how to debug the problem?

I have installed the Stack theme, and I want to make Danish translations. I have downloaded the Stack.pot file, made the modifications I need, and uploaded them to: /wp-content/themes/stack/languages/...
0
votes
0answers
28 views

Interface translation without plugins

EDIT 2: I am planning to implement a language switcher, but I don't have a clear understanding of how interface translation works in WordPress out-of-the-box, without multilanguage plugins (I don't ...
0
votes
0answers
21 views

Wrong language used while sending email from a filter callback

I'm sending email to admin and user when they filled a certain form. I'm using two different hooks then, one is this one: transition_post_status And the second is pending_to_publish Both seem to ...
0
votes
0answers
20 views

Menu names not getting translated

I've got the following code in a theme to register two menus: register_nav_menus( array( 'primary' => esc_html__( 'Primary', 'text-domain' ), 'secondary' => esc_html__( 'Secondary', 'text-...
1
vote
2answers
231 views

Wordpress theme with frontend in different language than backend?

I have added the po and mo files via Poedit for Chinese to my wordpress site. I would like to keep my backend in English. How can this be achieved? Is this possible without using a plugin such as ...
0
votes
2answers
77 views

Translation issue with global variables

I'm creating a plugin that supports internationalization. Everything is working fine, except for global variables. Strings in global variables will not get the appropriate translation. Explanation: ...
0
votes
1answer
33 views

Ajax WordPress pass post URLs

I'm using wp_localize_script to send post data to ajax. wp_localize_script( 'my-script.js', 'ajax_object', array('ajax_url' => admin_url('admin-ajax.php')) ); add_action( 'wp_ajax_load_more_posts',...
0
votes
0answers
22 views

WPLANG option not available in localhost

In my website which is multi-site, sub-directory, XAMPP based and hosted in local machine "WPLANG" option is not available for any site. But its available in azure based wordpress. Is there anything ...
0
votes
0answers
24 views

Translating WooCommerce product's additional info

I'm working on a WC based theme and I cant seem to find a way to translate the product's additional info dimensions. I tried it on a clean WC install with Storefront theme and there there is the ...
1
vote
2answers
48 views

Translated strings not appearing - what am I missing?

I've looked through all the similar threads I can find, and I think I should have all the pieces in place to have translated strings appear, but they are not. I'm about ready to pull out my hair! ...
0
votes
0answers
68 views

How do I make this plugin translation-ready?

I am in need of help with making a plugin translation ready. I do not have any experience in doing this what so ever, nor in php... If anyone could help, it would be much appreciated. This is the ...
0
votes
0answers
93 views

How to generate a rtl.css file for themes?

I'm developing a theme and would like it to support RTL languages. I'd like to automatically generate a partial RTL file, that is, with only the relevant selectors flipped, but every tool I've tried ...
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
0answers
32 views

Localization Not Working when script is loaded as a Dependency

Using the Simple Locator plugin which has some callbacks that the javascript will call if you redefine them to do something: function wpsl_before_submit(active_form, formelements){ console.log('I ...
0
votes
0answers
28 views

Embedding Facebook posts use the wrong locale determined by Facebook itself rather than WP

Using the default functionality from Wordpress to embed Facebook (posts or videos) are being displayed in the server's language. In my case, I use Cloudflare so the language changes however Cloudflare ...
0
votes
1answer
25 views

How to localize something coming from theme customizer

<p><?php echo get_theme_mod('simplisto_p'); ?></p> something is saved in the database through a theme customizer and then pulled through get_theme_mod. My Question → How to ...
1
vote
1answer
21 views

Is there a way to test that readme looks in other language before submitting translation?

I am adding the translation for my plugin's readme file in Spanish. I want to check if there is a way to test how my file will look on Wordpress site's page before submitting the translation?
0
votes
1answer
45 views

Can I set Wordpress to display languages based on system language without a plugin?

This question seems extremely straightforward, but hours of googling have led to no results. Here's the basic gist: I am building a site for Japanese viewers, and am using the theme's language folder ...
1
vote
0answers
71 views

How to register javascript variables in wp_localize_script?

When translating PHP-strings with variables, I use the following approach: sprintf(__('Some text <b>%s</b>, more text.','my-plugin' ), $somestring); When translating javascript strings, ...
-1
votes
1answer
206 views

How to use esc_attr__() function properly to translate a variable that contains string?

I am trying to develop a theme and trying to escape a string using esc_attr__() fuction. Here is how I implemented it. $title = stoic_get_the_site_title(); echo esc_attr__($title, 'stoic'); But ...
0
votes
1answer
48 views

How to ignore extra whitespaces in translation functions like _e?

I am passing few big strings in my code for translation to _e(). These strings were earlier broken into multiple lines with few leading white spaces before every line to maintain indentation & ...
1
vote
1answer
190 views

Should I always prefer esc_attr_e & esc_html_e instead of _e?

I am working to internationalize my plugin. As I can see on Wordpress site about esacaping, it says you should always use it. But as I can see in many popular plugins, they have used _e instead apart ...
0
votes
1answer
214 views

Can't we use strings defined as PHP constants if we want to translate them in a plugin?

I want to translate constant strings in my plugin defined as: define( 'CONSTANT', __( 'string-A', 'textdomain' ) ); And later using it somewhere like: $x= '<h4>'.CONSTANT_NAME.'<h4>'; echo ...
0
votes
1answer
19 views

How to prevent someone from entering strings without making it available for translation?

I am working to make all strings in my plugin ready for translation by putting them under __() or _e() as per requirement. Now in future to avoid others in my team to add strings without making ...
0
votes
0answers
49 views

Translation not working for Constant strings in Plugin

I want to translate constant strings in my plugin defined as: define( 'CONSTANT', __( 'string-A', 'textdomain' ) );. The 'string-A' is available for translation and I have uploaded the mo files in the ...
1
vote
1answer
63 views

Is it possible to set a different frontend- and backend-language?

my WordPress site is currently set to "English". I like the back-end to be completely in English, so it is easier to follow tutorial instructions etc. However, the front-end must be in German due to ...
0
votes
2answers
60 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 ...
0
votes
1answer
231 views

Why isn't my custom post type archive URL translating?

I've god a 'wine' custom post type, created with rewriting options: 'rewrite' => array( 'slug' => __('vini', 'fdr'), 'with_front' => false, 'pages' => false ), So the slug should ...
3
votes
0answers
63 views

How does WordPress choose which translation file to use?

One of my WordPress plugins has ended up with 2 different sets of translations for the same exact language (Spanish)... there's the one set of .mo/.po files I bundle with the plugin itself, and ...
-2
votes
1answer
64 views

How to change text depending on the country

a few texts fields on the site need to be different in one specific country on (Category & Custom home page) Eg: Class 1 (India) Grade 1 (UK) First Grade (US) Any idea on how I could do this ?...
5
votes
3answers
554 views

Locale filter in conjunction with new datepicker localization

So in WordPress 4.6 they added the localization to the jQuery datepicker to be automatic. I am posting here first because I am not sure if this is actually a bug with WP or if I am doing something ...
3
votes
1answer
97 views

POEdit with Custom mu-plugins code

I have a very strict directory structure I must adhere to within mu-plugins, but I would like POEdit to be able to help me generate translation files for specific code within this structure, while ...
1
vote
0answers
53 views

How can I change the permalink of a translated home page?

I'm working on a site that has both an English and Spanish localization using the Polylang plugin. On every Spanish page besides the home page, I can change the permalink by clicking the "Edit" button ...
1
vote
0answers
22 views

WP core emails translated

Is there a way to send out translated WP core emails? So with core I mean the emails like "Lost password", "New registration" etc. Currently my site uses WPML that does a good job however can't ...
1
vote
1answer
71 views

Can any users change locale language?

So, I have translated my theme with the Loco Translate plugin, and now I need give opportunity for unauthorized users to choose the language which they want to use. I see that WordPress uses .mo files ...
0
votes
1answer
88 views

How to configure PoEdit to pick up translation string?

I need to localise Flash theme, but don't know how to configure PoEdit to pick up such string. Tried: _nx:1,4c (but this picks up only Reply to ..) but does not find Thoughts on .. printf( /* ...
4
votes
3answers
1k views

How to print translation supported text with HTML URL

I am somewhat new in WordPress if it is about "deeper" customization. Now I am having this function: esc_html_e( 'Dear Guest, with Your information we not find any room at the moment. Please contact ...
1
vote
1answer
50 views

How to translate theme content using site language?

I have theme. For example code for comments: <?php 'fields' => array( 'author' => '<p class="comment-form-author">' . '<label for="author">' . esc_html__( 'Name','text_domain'...
0
votes
1answer
845 views

get_the_date() for translating date format

I want to display a in Hindi like "jan 10" using get_the_date(). What i have tried : <?php echo get_the_date(_e('F j')); ?> output like : F jJanuary 10, 2017.