Questions tagged [translation]

Translation is the term used to describe the effort to make WordPress (with themes and plugins) available in languages other than English for people from different locales, who have different dialects and local preferences. The process involves two main topics: internationalization (i18n) and localization (l10n).

Filter by
Sorted by
Tagged with
24 votes
7 answers
19k views

Change the text on the Publish button

Is there a way to change the text of the publish button on a custom post type to say some different? For example, Save instead of Publish. And also remove the draft button?
Paul Sheldrake's user avatar
11 votes
1 answer
6k views

Setting WPLANG from a plugin

For a single site wordpress, the language must be set from wp-config.php's WPLANG, but is it possible to set from my plugin which override the default value?
Howard's user avatar
  • 113
16 votes
3 answers
12k views

Override default WordPress core translation

WordPress is set to Dutch language. When I use get_the_archive_title() my theme correctly outputs "Categorie: Category-name" on a category archive page. However I'd like that to read "Sectie: Category-...
Florian's user avatar
  • 1,575
9 votes
1 answer
2k views

Is it ok to use a function to output the text domain name in a wordpress theme

I am working on a theme and I want to make it available for translating. I have not been including a text domain on translated text because I don't know what the text domain is going to be yet. I ...
Fabian Amran's user avatar
17 votes
6 answers
24k 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 ...
unfulvio's user avatar
  • 1,814
17 votes
7 answers
47k views

Different Language for Frontend vs Backend

I use an English WordPress package and this is very well. Now, I would like to translate some elements of the blog (like "posted on", "comments") etc., but do leave the dashboard interface intact in ...
serhio's user avatar
  • 315
13 votes
3 answers
22k views

Override parent theme translation on child theme

I have a parent theme that uses correctly load_theme_textdomain() to load all the translated strings in many languages. Then I created a child theme that uses load_child_theme_textdomain() to achieve ...
d79's user avatar
  • 577
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
8 votes
2 answers
12k views

How-to: Translate plural forms for themes/plugins with PoEdit

As the title says: How would you translate... _n() _n_noop() _nc() _nx() _nx_noop() ...in your .mo files?
kaiser's user avatar
  • 50.6k
39 votes
5 answers
116k views

Translate a plugin using .po .mo files

I want to translate this plugin. The plugin has already been translated into other languages and it has .pot files for adding new languages (as far as I understood from description). How do I create ...
Shimon S's user avatar
  • 887
24 votes
1 answer
41k views

What is a Theme textdomain?

I've found that any WordPress theme uses this functions, but I don't understand what is the purpose of it and what is it, in this case 'themify'? Here are some examples in Themify functions.php: 1). ...
Sok Vanrithy's user avatar
22 votes
3 answers
14k views

Change language by clicking a button

The goal is to offer a button/select drop-down or similar to switch the public interface1) language on the fly. What I'm searching for Plugin or Theme Code... ... or Ideas Using a work-around with ...
kaiser's user avatar
  • 50.6k
9 votes
4 answers
5k 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 ...
unfulvio's user avatar
  • 1,814
7 votes
2 answers
3k views

Filter translations (gettext strings) on specific admin pages

I'm trying to do a string replacement using gettext filter (source): function theme_change_comments_label( $translated_text, $untranslated_text, $domain ) { if( stripos( $untranslated_text, '...
Mayeenul Islam's user avatar
6 votes
2 answers
3k 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 ...
Scott's user avatar
  • 12.2k
6 votes
1 answer
1k views

Obtain a list of available translations

In answering this question: Change language by clicking a button. It was necessary to obtain a list of languages for which translations were available (i.e. their po/mo files were present in wp-...
Stephen Harris's user avatar
5 votes
1 answer
4k views

Set language per post

I have a bi-lingual blog with English as the main language and Arabic. Currently I use the post "Custom Field" to indicate that the post is Arabic and I use that in my child theme to change the ...
Fahad Alduraibi's user avatar
5 votes
4 answers
12k views

Changing the language of a single page

I have a wordpress site in a language that aligns RTL, but some pages are in English. These pages look terrible, however, because the English text is aligned with the RTL language, and punctuation, ...
Null_Error's user avatar
4 votes
1 answer
2k views

How to save a translation of a plugin in "CodeStyling Localization"?

Hi I was translating one of my plugins in "CodeStyling Localization". when I update my plugin my translation erased. Is there anyway to find it ? And How can I backup my translation (I don't want to ...
mahdiar's user avatar
  • 275
3 votes
2 answers
3k views

List of Default Translated Phrases

With <?php _e('Save Changes') ?>, I know the phrase, "Save Changes" can be translated automatically if the user's locale is set to a different language. I'd like to know if there is a list of ...
Teno's user avatar
  • 183
1 vote
1 answer
919 views

Translations does not work with .pot file

I've created a theme at underscores.me and it seems it is multi-language ready. There is a .pot file in the language folder, so I downloaded POEdit and translated the things in there (like Posted on, ...
Hans Ullrich's user avatar
0 votes
1 answer
127 views

Best location for theme translation files

I usually store language files in /languages folder that is located in theme folder and it's also recommended location by WordPress as well. However, it still doesn't look like the best solution ...
Mertafor's user avatar
  • 103
25 votes
1 answer
21k views

When to use _e and __ for the translation?

What is difference between _e() and __() functions for the translation? In what cases e() and __ ()should be used?
jay's user avatar
  • 267
16 votes
2 answers
6k views

pass object/JSON to wp_localize_script

I've got a working piece of javascript that contains an object literal. But I need to localize it, and I'm ytrying to figure out how to rewrite it so that I can get wp_localize_script() to accet it, ...
mikkelbreum's user avatar
  • 2,456
10 votes
3 answers
25k views

generating po mo translating files from scratch in a wordpress theme

Maybe I'm missing something here but I really can't find any answer to my question around the web. I am creating a new wordpress theme from scratch (literally from scratch) and would like to create ...
gil hamer's user avatar
  • 661
9 votes
1 answer
20k views

Translate widget titles using qTranslate plugin

I'm actually using the qTranslate plugin to translate my website. It works really well with everything except one thing. the titles of my sidebar widgets. Actually, to translate some words we need to ...
kschaeffler's user avatar
7 votes
1 answer
7k 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', true,$newspost['ID']...
Decneo's user avatar
  • 73
7 votes
2 answers
5k views

gettext does not translate when called in ajax

When loading content in gettext calls (__(), _e(), etc.) they translate fine when I render the page in the browser normally (PHP delivers the content to the browser), however when I make AJAX calls, ...
ako977's user avatar
  • 171
7 votes
2 answers
9k views

why is translation not working on theme?

Background I am using the theme Rookie from Sportpress. I created a child theme. Translation files are existing, especially german in my case. Wordpress is set to german language. The Problem ...
André Kelling's user avatar
7 votes
2 answers
8k views

[Plugin WPML] : How to create a translation of a post using the WPML API?

I'm trying to figure out how to create a translation for a post using the internal WPML API (inc/wpml-api.php) I simply want to create a translation for post ID xx, set some content and publish it. ...
mike23's user avatar
  • 5,981
5 votes
1 answer
4k views

what's different between _x() and _()

What's different between _x() and _(). For example: if a1 can translate as: a1 has meaning x1; a1 has meaning x2; How _x() function to get value x1 or x2?
wordpressquestion's user avatar
4 votes
2 answers
929 views

Use override_load_textdomain for cache translation and improve performance

I have a multisite wordpress with multiple localized sites (es_ES, de_DE, it_IT). I want improve page speed by caching wordpress translation file. My code works (inspired by Tristan Darricau)! and ...
ar099968's user avatar
  • 295
3 votes
1 answer
3k views

`wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin

Short description: I try to translate strings in JS file. To test it I decided to create a simple test plugin. I have PHP and JS strings there. Translated PHP strings work fine, JS strings don't work. ...
kanlukasz's user avatar
  • 484
3 votes
1 answer
2k views

Make a custom theme translate-ready

I created a my own theme, now I wish to make it translatable. I made two files: theme.pot msgid "know_more" msgstr "Vuoi saperne di più?" it_IT.po msgid "know_more" msgstr "Vuoi saperne di più?" ...
WalterV's user avatar
  • 197
3 votes
1 answer
1k views

How does gettext works for translating readme file of plugin?

I am doing translation of my plugin. I am using __ & _e in php files. But can't figure out how to do same for readme.txt file? Is it's content on Wordpress site's plugin page automatically get ...
learning_13's user avatar
3 votes
2 answers
444 views

Difference between 2 internationalization (i18n) functions __() & _e()

I'm learning from a plugin development course, and encountered two different internationalization functions: <?php __('Newsletter Subscriber', 'ns_domain'); ?> & <?php _e('Title:'); ?&...
Steve's user avatar
  • 1,707
3 votes
1 answer
255 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', ...
jay's user avatar
  • 65
3 votes
0 answers
85 views

Custom values are not translated

I'm trying to translate my plugin. Inside plugin's root folder I have 'inc' folder, where located registration.php file. This file has a code, which adds custom fields to comment form. (I use right ...
anton's user avatar
  • 1,033
3 votes
1 answer
2k views

Translate Navigation Menu & Sidebar Widget Titles

Is there any plugin to translate navigation menu & sidebar widget titles ?
Raptor's user avatar
  • 272
2 votes
1 answer
6k views

Internationalize / translate custom post types & taxonomies

I've created custom post type and taxonomy via generator, but not quite sure how to make it translatable. Google doesn't help in this. I have no idea where to put text-domain here and things what I've ...
denoizzed's user avatar
1 vote
2 answers
385 views

Localization / textdomain is slow and chaotic

My theme has a lot of templates. Most of them contain messages in the usual way: echo __('This is the message','mytextdomain') This has several disadvantages. For instance, if I want to change the ...
cjbj's user avatar
  • 14.4k
1 vote
2 answers
2k views

Make theme translatable for WPML

I have been really hard time to get my site translated. I have MO and PO files, but my theme is not compatible with WPML and the developer team doesn't to change it. Therefore I may have to build a ...
pulla's user avatar
  • 713
0 votes
1 answer
351 views

Why should I escape translatable strings? and how shall i do that?

Is it really need to escape translatable strings?
user avatar
0 votes
3 answers
109 views

Should we localize custom-made themes / plugins?

Does anyone know how much do the localization functions from WordPress affect the speed of a website? Do you think it's worth replacing all strings with gettext inside a theme, even if it will only ...
onetrickpony's user avatar
  • 13.6k
0 votes
1 answer
8k views

Change language of comments template

I have a Wordpress installation in italian, I need to keep italian for the admin section but the frontend needs to be in english. The theme is custom so that's ok, but in single posts I'm using ...
Matteo Riva's user avatar
0 votes
1 answer
2k 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. ...
Shamima Saleem's user avatar
0 votes
1 answer
5k views

How to load theme textdomain from plugin?

I built a simple localization plugin to suit some specifications needed by my orgnanization. For each language there is a single .mo file that contains both the theme translations as the page content ...
Lisandro Vaccaro's user avatar
0 votes
2 answers
927 views

Dynamically redirect page based on URL?

I'm making a translation system for my website and I'm having troubles with URL rewriting. Each page is translated to multiple languages and should have different URLs for each language, e.g.: /en/...
Victor Marchuk's user avatar
0 votes
4 answers
14k views

get_the_date() for translating date format

I want to display dates in Hindi format like jan 10 using get_the_date() function. What I have tried so far: echo get_the_date(_e('F j')); which outputs: F jJanuary 10, 2017.
shubham shah's user avatar
0 votes
2 answers
1k views

How to handle single quote in a translatable string in Wordpress

I have two translatable strings as follows in my 404.php file esc_html_e( 'I couldn't find the page you were looking for.', 'themename' ); esc_html_e( 'Try a search or one of the links below.', '...
developer's user avatar
  • 151