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
0
votes
1answer
830 views

wordpress plugin translation not working

I have no idea what is wrong here. First I would like to share probably all required info. Plugin tree: $ tree . ├── classes │   ├── database │   │   ├── plugin-auth.php │   │   ├── plugin-user.php │...
1
vote
1answer
738 views

loco translate plugin edits file in plugin folder

I'm creating a plugin that must be translatable. Under plugins/my-plugin/languages I've my .po, .pot and .mo files. When I translate something in loco plugin I can see translation applied as ...
1
vote
1answer
260 views

Internationalization: Not loading plugin translated text

I am trying to internationalize the plugin I am creating but it doesn't seem to display the translated texts that are translated in the .po file. Firstly, I have referred to the following sources: ...
5
votes
2answers
4k views

Disabling Translation Update

There are two ways that WordPress updates translation files inside Languages folder: 1. Automatic updates whenever it gets triggered. 2. Manually when user requests it on "Updates" page. Is there a ...
2
votes
2answers
438 views

Ajax - gettext without a plugin

How would you go about setting the correct language returned in AJAX calls, when you are not using any plugin? All other strings in page work fine just by defining WPLANG to a proper locale. ...
0
votes
0answers
52 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 ...
1
vote
1answer
1k views

How can you locate the .po file used for translation of a page?

I'm trying to translate a plugin, Dokan Pro, but I can't seem to find the correct .po file that my Wordpress site is using to translate. Part of it is already translated in Italian, but other parts ...
0
votes
2answers
47 views

menu customization

I am using a premium theme on my page. The theme only accepts one menu in the whole site. The site is a single page site. And the way the theme works is that we have to set up a Home Page and then ...
0
votes
0answers
28 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-...
0
votes
1answer
114 views

Trouble translating a Child Theme

I'm having a hard time trying to use a custom translation for my child theme based on Storefront (WooCommerce) For some reason, the translation doesn't take effect. Here is what I did: Created a ...
1
vote
1answer
625 views

Translate MCE button text/tooltip in custom plugin

I am using a custom MCE button in my wordpress custom plugin below is my code function enqueue_plugin_scripts($plugin_array) { //enqueue TinyMCE plugin script with its ID. $plugin_array["...
5
votes
2answers
3k views

Overriding single plugin translation

Is it possible to override single plugin translation in function.php file and how that can be done?
0
votes
2answers
245 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
49 views

Do translation functions like __e() have to take strings in English in themes?

I'm developing a theme and curious if strings could be written in a language different from English and still be properly translatable? What I mean is when using translation functions in a custom ...
1
vote
2answers
686 views

How to translate WordPress Emails?

I'm running a multilingual site, and I want the emails sent to the user to be in their language. The scheme I already have is the following: The website determines the user's country through their IP....
0
votes
0answers
15 views

How to post one comment for all the translated posts

I have a commenting system with wordpress multilingual website on custom post type "recipe". Where anyone can comment my issue is i have english, spanish and german as my website language.. if someone ...
1
vote
2answers
5k views

How to edit T&C checker text in Woocommerce checkout page? gettext?

I'm trying to edit wording in terms & conditions checkbox on checkout page (order review section), but without luck. It was easy to edit other fields like billing and shipping fields. But I'm not ...
0
votes
1answer
140 views

Add language localisation to javascript alert?

I have a series of language files for a plugin. It all works as expected. If I add a javascript alert, how do I translate the text of the alert? PHP would be __('example text', 'context'); What is ...
1
vote
2answers
550 views

.mo translation strings not loading in PHP scripts that handle AJAX calls

using the standard __('some-string', 'myplugin') for translations, strings are being correctly loaded for a Japanese (ja) locale in every function and script other than my AJAX functions. my-plugin....
0
votes
0answers
17 views

Plugin: Translated plugin is "not translated"

I created a "site specific plugin" what adds a custom post type to my wordpress instance. I made a .po file for it with PoEdit and even Loco Translate shows that it's 100% translated, but it's not ...
2
votes
1answer
11k views

How to add translation for a string

My wordpress website is using non-english language (e.g chinese), and its backend already turned to chinese but in wp-content\plugins\divi-builder\includes\no-results.php (i'm using divi builder, in ...
2
votes
2answers
921 views

use __($str) to translate strings (symfony/twig)

I usually use frameworks like Yii(2), Zend or Laravel to build pages but a customer forced us to use Wordpress this time. I integrated Symfony/Twig as my template engine but now I have trouble with ...
0
votes
1answer
2k views

How to translate wordpress error message

I have a problem and I am not finding the variable to solve, I have a site in WP and when I try to login and neither the password nor the email exists, I get the error message: ERROR: The username or ...
1
vote
1answer
23 views

How can I check if a var is equal a translated label?

In my plugin, I can publish a custom post. When I click on the "Publish" button, I have this data $_POST Array ( [foo_title] => test [foo_price] => ... [save] => Publier ) ...
1
vote
0answers
33 views

Build a translation correcter plugin

I'm planning on creating a plugin that fixes the translation issues of a specific theme. This theme is already translated into multiple languages but the translation is horrible. I don't know how to ...
0
votes
1answer
875 views

esc_html__() and __() not working within arrays

I'm creating a widget but the title and description is not translatable. I'm often face this problem with arrays, I use esc_html__() inside the array which is supposed to return the translated ...
1
vote
0answers
15 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
25 views

Wordpress does not translate

I have a Wordpress site (Version 4.8.3). I wanna have the backend and frontend in German (Deutsch). I switched in Settings -> General Settings -> Site language to german. I have added define(...
3
votes
1answer
503 views

Change text of twentyseventeen_edit_link()

Where do we go, or what do we do in order to change the default text displayed as Edit for the given function twentyseventeen_edit_link() which is originally part of the tweentyseveteen theme. Thanks
2
votes
1answer
236 views

How Wordpress knows where to find locale files?

I just used Poedit to translate a plugin with no translations. I found strings to translate and I generated the .POT file and the .PO and .MO in my language. I created a folder languages in the ...
1
vote
1answer
31 views

A new translation folder overrides my usual translation from "nowhere"

So I got to work on something really specific and strange on an old Wordpress I havn't edited already. The website is in French and English and this is a translation problem. To summaries the problem ...
0
votes
2answers
5k views

Using polylang, how can I see which post is the "original" and which are the "translated children"?

I am using Polylang. It is not obvious to me how the relationship between posts are established. I can switch between different language versions of the same post, and I can tell that they're (...
1
vote
1answer
7k views

Add a string to file .pot using Poedit

I want to add a string to a pot document for language, but it says there’s an error. I have opened file .pot with a text editor and I have add this code #:D:\Programe\InstantWP\InstantWP_4.3.1\...
-1
votes
1answer
283 views

How to translate WP plugin name?

My plugins are translated ready. I've created their pot, po and mo files in 2 languages for each one using PoEdit Pro and all of my plugins are loading the translation files correctly. But there's a ...
1
vote
1answer
135 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

How to store in the database directly the translation?

I would like to store my custom posts with the correct translation when the user activate the plugin. $a_custom_post = array( 'post_type' => "foo-page", 'post_status' ...
1
vote
1answer
59 views

How to set translations in javascripts for my plugin?

I have in my plugin : form.js : js script to do a custom validation on form fields js_lang.php : based on this stackoverflow post my-plugin-domain-fr_FR.po In form.js, I use a var (msg_must_match) ...
1
vote
0answers
45 views

comment form args are not translatable (customized comment form)

I customized the comment form by changing the 'args'. Short Example: $comments_args = array( 'title_reply' => esc_html__( 'Leave a comment', 'mytheme' ), 'title_reply_to' =&...
0
votes
1answer
147 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 ...
2
votes
2answers
609 views

How can I make "Leave a comment" translation ready?

I can't get this line of code translation ready. <?php comment_form(array ('title_reply' => 'Leave a comment')); ?> Thank you very much! Best wishes, Pierre
5
votes
4answers
8k 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, ...
0
votes
1answer
220 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
443 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
1k 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
123 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
143 views

Use the wp-admin translations on the front end

Currently I'm working on implementing the user profile form on the front end. Unfortunately the front end core translation file (wp-content/languages/lang_LANG.po) doesn't have any of the translated ...
0
votes
1answer
76 views

How does translation (gettext) work for translating config 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 config file that contains constants added using define(name, value)? Does it ...
2
votes
1answer
822 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 ...
0
votes
0answers
122 views

Debug WordPress gettext function

The gettex function: ('__') receives the original string, in spite of the fact that the po file has the translation of the string. It happens accidentally. Is there any method to find out the error?

1 2 3
4
5
11