Questions tagged [localization]

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

How are themes and plugins localized using the gettext GNU framework?

The documentation page for the GNU gettext framework says, Specifically, the GNU gettext utilities are a set of tools that provides a framework to help other GNU packages produce multi-lingual ...
0 votes
0 answers
8 views

How to translate user added content in a plugin

Whilst I understand how to make text in my plugin & theme templates translatable, how do I translate text that has been added by a user in the plugin settings page, since I do not know what that ...
0 votes
0 answers
30 views

How to have WP admin in English while public website is in another language?

I have a website localized in Italian, but I need WordPress admin not to take the main website language as defined in settings and remains in English. Does anyone know how to do this?
  • 165
0 votes
1 answer
28 views

Creating a redirect option for current page url

I am running a multisite network with around 8 websites. Currently, some sites have more content than others(for example, mysite.com/uk and mysite.com/dk have more posts). What I am trying to achieve ...
2 votes
3 answers
144 views

Using wp_set_script_translations without manually registering the script

When using @wordpress/create-block to scaffhold a plugin for a block, the generated bundle is automatically registered via the block.json metadata : { ... "name": "my-block", ...
0 votes
1 answer
10 views

Do I have to use load_plugin_textdomain() or is there any default folder for languages?

When I develop a plugin, do I always have to use: load_plugin_textdomain('whatever', '', 'whatever/languages'); Or is there any setup, so that I put my translations into a specific folder with a ...
1 vote
1 answer
26 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"
1 vote
1 answer
42 views

What does the underscore translate function do in my code without a textdoman

I am hooking into comment_form_default_fields doing some heavy string replacements. There are translated strings like __( 'Name' ) in there. I need the text. I have two or three different ways to ...
0 votes
0 answers
53 views

Creating dynamic content and pages for 1000's of locations

How can I generate dynamic pages on a Wordpress website from information provided in a separate MySQL database? I have a database with Locations and I would like to have a page for each of these ...
1 vote
1 answer
32 views

How to render a time-of-day string like '16:42' with a site's chosen time format?

I have a need to display a time-of-day value in a site's chosen time format. For example I have 16:42:18 and want to display it as 4:42 PM if the time_format option is g:i A, or 16:42:18 if the ...
  • 441
0 votes
1 answer
38 views

Set two terms for a post when they differ only by an accent

I face the following situation: after manually adding (in the backend) the terms with names (not slugs) Mânie and Manie, that differs only in an accent/diacritic (they are totally different words with ...
  • 1,101
0 votes
0 answers
7 views

How to find which .mo file is responsible for displaying a particular localized string?

Is it possible to find it out by examining the source code or by using the developer feature Inspect (like a style and its corresponding .css)? I know I can copy the entire content of the site and ...
  • 1
3 votes
1 answer
200 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 ...
  • 601
0 votes
0 answers
23 views

Is there some ways to autofix the mo or po files instantly?

$ msgfmt -o en_CA.po en_CA.mo en_CA.mo:1:2: syntax error en_CA.mo:1: keyword "P" unknown en_CA.mo:2: end-of-line within string en_CA.mo:2:43: invalid control sequence en_CA.mo:3: end-of-line ...
0 votes
0 answers
42 views

I want to dynamically create i18n ecosystem in WordPress

In WordPress, "__(), _e() etc." I want to create an ecosystem that finds locations and automatically generates ".pot" files. <Just like WPML.> Some research for this led me ...
  • 23
0 votes
2 answers
449 views

Multilingual website without third-party plugin

I used to use third-party plugins (I tested both free and commercial ones) to do bi-lingual Wordpress websites, but now I want to be less dependent on third-party plugins. Question: Have you achieved ...
  • 1
0 votes
1 answer
39 views

Translations for my plugin don't show up

I'm pulling my hair out with this one: I want to provide translations for my plugin, but they're not showing up. I followed the documentation and took the following steps: Set up local wordpress ...
0 votes
1 answer
40 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 ...
2 votes
1 answer
591 views

How to set the localization for a Gutenberg block?

I'm trying to set localization for a Gutenberg block. After scaffolding a basic block with wp-cli command npx @wordpress/create-block, I need to set localization. I've create my pot file and ...
0 votes
0 answers
7 views

Changing wp admin user's language does not update all of the plugin localizations in backend [duplicate]

I have a custom MU plugin mup for which I've coded some custom admin pages. For these and all of their related strings; I've successfully created the according .mo files and placed them all both in: ...
  • 391
0 votes
2 answers
267 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 ...
  • 391
1 vote
0 answers
83 views

Translate emails into the language of the user

The following scenario: An admin activates a function or similar for a user (in the WordPress frontend). Now the user should be informed about this by email. Therefore an AJAX call is sent to the ...
  • 11
0 votes
1 answer
29 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( $...
1 vote
1 answer
121 views

Frontend language per user

There is a function of internationalization plugins on WP. If I make .pot files I can translate my plugin to any language. When I install a plugin to website I can choose any language and the plugin ...
1 vote
1 answer
112 views

Multisite: How can I have the admin bar (toolbar) use the language of the user instead of the language of the sub-site being viewed?

By default in a network install, when viewing a sub-site, the sub-site language is used for the admin bar (toolbar). How can I have the admin bar (toolbar) always use the language of the user?
  • 3,007
0 votes
1 answer
17 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&...
0 votes
1 answer
83 views

jQuery Datepicker displays wrong language until interection with the calendar

In a totally custom page, written as a PHP snippet using Woody Snippets plugin, I need to use a jQuery datepicker to select a date. I imported the necessary files correctly, and also called and set up ...
0 votes
1 answer
13 views

Language string not detecting used within the function

I am using Mpdf lib to generate PDF for the plugin I am developing. The PDF has much more tabular data that require localization. For that, I have created a function for TH and TD as below. function ...
  • 1,350
0 votes
1 answer
12 views

Do I lose translations when I change my Text domain for my plugin on wp.org?

In readme * Text Domain: advanced-responsive-video-embedder Do I lose translations when I change my language domain for my plugin on wp.org? I am annoyed by advanced-responsive-video-embedder ...
1 vote
0 answers
774 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 ...
  • 111
0 votes
1 answer
24 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
30 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: ...
  • 203
3 votes
1 answer
2k 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. ...
  • 452
1 vote
1 answer
86 views

Multisite: How to get a list of installed languages

In a network install there is a language setting which will let the super admin user install a language from a list of available languages. How can I get a list of the installed languages? For example,...
  • 3,007
0 votes
2 answers
101 views

Transform internationalized plugin into internationalized mu-plugin?

I developed a custom plugin with the following structure in my folders: wp-content --- plugins ------ my-plugin --------- languages ------------ po and mo files --------- my-plugin.php I ...
  • 391
0 votes
1 answer
314 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, ...
1 vote
1 answer
240 views

Plugin translation not working apart from name and description

I wrote a plugin that creates a custom post type and I tried to translate it using Poedit, but it's not fully working. I did translate a few other plugins before and I'm not sure what's causing this ...
  • 113
3 votes
3 answers
1k views

How should you internationalize javascript spread in multiple files but build in one?

I have followed the instructions for internationalization on: https://developer.wordpress.org/block-editor/developers/internationalization/, but it doesn't seem to play well with the development tools ...
  • 1,009
0 votes
1 answer
53 views

Get localized user roles

I have a settings page that shows the users wordpress role. I am using wp_get_current_user()->roles get that list. However, that list appears in English, and often my users have their locale set to ...
1 vote
1 answer
204 views

Gutenberg block JavaScript localisation on Polyglots does not work

I can successfully translate my plugin using wordpress.org for all php strings. Everything is fine. I can even see the strings that needs translation on https://translate.wordpress.org/projects/wp-...
  • 601
0 votes
1 answer
104 views

Decimal values via get_option() with custom local (decimal point = comma)

I have a tricky bug in a plugin and I'm trying to figure out who's fault it is. The plugin uses in its init method a check if the DB has to be updated. And the child theme I'm using has set a custom ...
  • 147
0 votes
1 answer
56 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
2k views

How to allow single quote with esc_html__() without sprintf()

Because of security reasons we are of course required to use esc_html__() for WP development. This is annoying because if you'd want to pass a single quote into your strings, you'd have to use sprintf(...
1 vote
0 answers
59 views

Unable to find where to translate certain tooltip string

I am working with the Store Shopline theme on Woocommerce, and am trying to set up a version which is localised to German. This is going ok, however, I can't seem to get a hold of the text string ...
  • 111
3 votes
1 answer
184 views

How can I translate the name of my Plugin for other languages?

How can I translate the name of plugin for other languages? For example: When Wordpress is in pt-BR language, the plugin would be "Meu plugin". If the Wordpress is in en-XX language, the plugin name ...
1 vote
0 answers
79 views

Is it possible to use multiple post_name, post_title and post_content?

I'm actually writing a localization plugin. Here I have developed something like "localhost/post-title", "localhost/de/post-title", "localhost/ru/post-title". From this point on, is it possible to ...
  • 290
0 votes
1 answer
88 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 ...
  • 115
0 votes
1 answer
230 views

Why does my WordPress Upgrade version have a language suffix?

In My WordPress dashboard at update-core.php, it says: An updated version of WordPress is available. You can update to WordPress 5.3–en_GB automatically: [Upgrade button] (This ...
  • 449
0 votes
1 answer
304 views

WordPress add_filter to post_date

I using a plugin that it makes posts and etc date to Persian Date but the problem is I just want to convert date in front not admin panel or etc. I found that part make this action: add_filter('...
2 votes
1 answer
2k views

Headless Wordpress: How to authenticate front end requests?

I am envisioning Wordpress on the back end to work with React.js on the front end like this: Wordpress is installed on http://example.com/api React.js script is loaded into http://example.com/index....
  • 347

1
2 3 4 5
7