All Questions
Tagged with translation localization
121 questions
0
votes
1
answer
334
views
Custom post type slug localization
I need to have 2 languages in a website (EN and LT).
I have a custom post type 'services'.
I need to have the links like this:
English version of the service: '/en/services/some-service'
Lithuanian (...
1
vote
0
answers
51
views
Save translation file of third party plugin in a custom plugin?
I have a custom plugin that I install on a handful of client sites. All the client sites uses a third party premium plugin, and I have translated that plugin to another language and saved the ...
0
votes
1
answer
150
views
Admin Notice is only localized when displaying the "Plugins" Backend Page
My plugin checks if a specific theme is activated. The check is hooked on init.
If the theme is not activated, it displays a warning, hooked on admin_notices.
This works fine.
Now I added localization ...
1
vote
1
answer
61
views
Should I include colon in my msgid in PO file? [closed]
Which of the below is recommended when creating msgid a PO file?
msgid "Available Balance:"
or
msgid "Available Balance"
3
votes
1
answer
569
views
WordPress: After Gutenberg plugin migration to block.json the localization/ translations with PolyGlot in JavaScript does not work anymore
I made a plugin with existing localization on WordPress.org for free. I migrated to block.json and made all changes by comparing it to the output of npx @wordpress/create-block todo-list. I read ...
0
votes
1
answer
75
views
Use localized plugin name and description even when the plugin is disabled
I'm working on plugin development and I'd like to localize my plugin name and description, so that these two pieces of information are shown to other WordPress developers in their native languages (if ...
0
votes
2
answers
746
views
Setting Email locale before retrieving gettext translations
I developed several plugins which I localized using the standard approach with __() functions and the .po or rather the .mo files. All of this works like a charm.
What I now want to be able to do is ...
0
votes
1
answer
45
views
Issue with translation - Gutenberg
Here is my code.
I based it on CapitaineWP formation and template.
I have the .pot, .po, .mo and .json files.
$script_asset_path = PERSO_FOLDER."/build/index.asset.php";
if ( ! file_exists( $...
0
votes
1
answer
27
views
how to unlocalize theme/plugin?
I have theme with this code in one php file :
'logged_in_as' => '<p class="logged-in-as">'.
sprintf( __( 'Logged in as <a href="%1$s">%2$s</a&...
1
vote
0
answers
2k
views
Generate JSON files for language translation from po file without wp-cli i18n make-json
My plugin uses wp_set_script_translations() to load translations for JS as mentioned here https://make.wordpress.org/core/2018/11/09/new-javascript-i18n-support-in-wordpress/.
I understand that when ...
0
votes
1
answer
82
views
Plugin language always shows WP site language, not profile language
I wrote a plugin that I translated from English to German.
The German translation only shows up, when I change the site's language to german. Once the site language is set to German, it will always ...
0
votes
1
answer
53
views
Is hint for translator compulsory while internationalizing a string containing variables?
I am following this official guide to internationalise my plugin. But I am confused if the hints are must required incase of variables inside string?
printf(
/* translators: 1: Name of a city 2: ...
4
votes
1
answer
4k
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.
...
0
votes
1
answer
570
views
String translation within WordPress multisite with i18n not working on all sites
Using
WordPress Multisite (subdir)
Child themes
Loco Translate
The Issue
One of our multisite sites isn't string translating (Japanese). We started with non-multisite with just English. Then, ...
0
votes
1
answer
78
views
How to become a translator on wordpress.org?
I tried to find the solution on WordPress.org, but to me as a new contributer, the documentation seems confusing, and links like "Become an editor." in the "Translation Editors" on a plugin's ...
0
votes
1
answer
390
views
Translation from .mo file not working in theme
I'm trying to add translations to my theme. I went through the documentation and many questions here on Wordpress Development Stack.
Setted a text domain in my style.css file:
/*
Theme Name: My ...
0
votes
1
answer
158
views
Wordpress in French Language [closed]
I am migrating a French wordpress website.
After completion the website keeps displaying special characters,
specially the black diamonds with white question mark inside �.
I have installed the PO ...
0
votes
1
answer
583
views
I dont know why my localization is not working
I am working on a Plugin for Wordpress and I'm not able to get the Internationalization working.
Here is the GitHub Link: https://github.com/dev-nm/WP-StudioLink-Integration
I used wppb.me as a ...
1
vote
1
answer
294
views
Should I change text-domain of TGM library inside theme?
I created a theme and I want to publish it in wordpress.org. I used TGM library to check to require plugins. but the Theme-check get bellow warning:
Warning: More than one text-domain is being used ...
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.
...
0
votes
1
answer
1k
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
2
answers
53
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: /...
1
vote
0
answers
81
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
1
answer
53
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
0
answers
66
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
0
answers
48
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
2
answers
376
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:
...
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 ...
1
vote
1
answer
207
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
1
answer
321
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 ...
0
votes
1
answer
370
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
1
answer
524
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
1
answer
2k
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
1
answer
21
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
0
answers
206
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 ...
2
votes
0
answers
179
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
1
answer
294
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 ...
9
votes
3
answers
13k
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 ...
0
votes
4
answers
16k
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.
0
votes
1
answer
3k
views
/languages/ folder missing in default themes
I noticed that previous default themes used to have /languages/ folder which is now gone.
Is it now a good practice to not include the /languages/ folder when creating a custom theme? How do theme ...
0
votes
1
answer
2k
views
How to translate functions.php?
I am working on functions.php in a child theme, Here I have a CPT and custom taxonomies for my project. The only thing I need to translate taxonomies and CPT right from the functions.php and be sure ...
3
votes
1
answer
64
views
Localization works but still get "This plugin is not properly prepared for localization" msg in directory
Several users of my RSVPMaker plugin have submitted translation/localization files that I have redistributed, but for some reason the page in the WordPress.org repository that is supposed to help with ...
1
vote
0
answers
49
views
How can I change the language of automated Mails?
I've got a problem with translations, that sounds pretty simple, but I can't find a way around this.
The Situation
I got a software running on WordPress, and I need to send Emails to my users after ...
3
votes
2
answers
481
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:'); ?&...
1
vote
2
answers
2k
views
Override plugin text domain in child theme
I have a plugin YITH Wishlist in use and I want to override their translation with my own translation which I have included in my child theme.
So basically I created this folder:
/mychildtheme/...
0
votes
1
answer
298
views
Plugin not properly prepared for localization
I published my first plugin (https://wordpress.org/plugins/multi-google-analytics/) on WordPress.org and I get this notice about it not being prepared for localization, even though it's perfectly ...
0
votes
1
answer
84
views
Can the qTranslateX-Plugin translate non-article text? [closed]
I started using the qTranslateX plugin for a bilingual Wordpress site, and I am very happy with how it translates posts and pages. However, there is some text on the site that was entered as part of a ...
1
vote
1
answer
168
views
Proper use of internationalization
Regarding internationalization which of the two would be the proper correct way to process the translation.
echo '<p>' . esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipisicing', '...
1
vote
1
answer
1k
views
Generate PO File
I wish to localize some text in my child theme.
I followed the instructions here:
https://codex.wordpress.org/Child_Themes#Internationalization
However, I just created empty po files (eg: he.po) ...
0
votes
1
answer
34
views
Localization of WP theme
I am working on WP theme localization. On custom search template I have function which gets text of some search terms and replace them with other (just visually).
function search_replace_search() {
$...