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
15 views

Different Menu for Per Language with Polylang in Twenty Twenty-Three Theme [closed]

In classic themes built we could create new menus for per language created with Polylang. Like “MENU EN” for English, “MENU TR” for Turkish. I can create different menus per language from theme ...
berkb's user avatar
  • 113
1 vote
0 answers
19 views

How to show the front end in a different language? I am using the twentytwentythree theme

I don't see the language files in the theme folder. Shouldn't they be available by default? Once I get the language files, where should I copy them and what should be the naming convention? Will all ...
Roz's user avatar
  • 21
0 votes
0 answers
14 views

i18n: How do I load translations for a language specified in the request?

So I know how __, _e etc. work. They fetch the translations on the basis of the site language selected in the General settings. My challenge is slightly different: I want to provide the ability to ...
Roz's user avatar
  • 21
-1 votes
2 answers
288 views

How to get locale within WP REST Request?

When sending requests to the WP REST API / custom WP REST endpoints, which is the way to go to retrieve the current locale; a universal way which always works? I'm confused by the many functions ...
DevelJoe's user avatar
  • 435
1 vote
0 answers
26 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 ...
Torben's user avatar
  • 11
0 votes
1 answer
75 views

React Plugin Settings Page Localization

I'm learning how to make plugins, and Thanks to Sally CJ managed to get translation working on the PHP files, and the Gutenberg Block... (If any need help on this check here ) But, I can't make it ...
Jorge's user avatar
  • 25
2 votes
1 answer
97 views

Localising a Block

I'm trying to localise my Gutenberg plugin and block, the PHP side is translated but zero luck on the js side. I tried the official guide, few other blog posts, the solutions posted in this post enter ...
Jorge's user avatar
  • 25
0 votes
1 answer
62 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 ...
Maxwwos's user avatar
0 votes
0 answers
26 views

.po file is loaded but changes are not appearing

I made a translation file (fr_CA) and it's loading. But any change I make in the file does not appear on website. Clear cache, private window, other browser. It's all the same. I don't get it... What ...
PEROY's user avatar
  • 1
0 votes
0 answers
64 views

Import js variables loaded via wp_localize_script() into js module without global scope connection

Assuming you have the following script with its variables that you enqueue as js module to a given page, via the following code in your main plugin file: wp_enqueue_script( '...
DevelJoe's user avatar
  • 435
0 votes
0 answers
10 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 ...
brittle_spirit's user avatar
0 votes
0 answers
10 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 ...
Chris J Allen's user avatar
0 votes
0 answers
50 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?
MKay's user avatar
  • 177
0 votes
1 answer
34 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 ...
tearswep's user avatar
5 votes
3 answers
509 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", ...
drskullster's user avatar
0 votes
1 answer
22 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 ...
Álvaro Franz's user avatar
1 vote
1 answer
42 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"
ratib90486's user avatar
1 vote
1 answer
95 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 ...
NextGenThemes's user avatar
0 votes
0 answers
103 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 ...
itsthatseoguy's user avatar
1 vote
1 answer
34 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 ...
O. Jones's user avatar
  • 471
0 votes
1 answer
68 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 ...
Yurié's user avatar
  • 1,101
3 votes
1 answer
376 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 ...
Marc's user avatar
  • 645
0 votes
0 answers
47 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 ...
G.D.i's user avatar
  • 23
0 votes
2 answers
1k 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 ...
jontwo's user avatar
  • 1
0 votes
1 answer
69 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 ...
Mepsipax's user avatar
0 votes
1 answer
55 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 ...
zeko868's user avatar
3 votes
1 answer
1k 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 ...
Francesco Tropicalista's user avatar
0 votes
0 answers
15 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: ...
DevelJoe's user avatar
  • 435
0 votes
2 answers
472 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 ...
DevelJoe's user avatar
  • 435
1 vote
0 answers
136 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 ...
Farley's user avatar
  • 11
0 votes
1 answer
37 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( $...
David Dufour Morin's user avatar
1 vote
1 answer
187 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 ...
ALexander Lead's user avatar
1 vote
1 answer
223 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?
henrywright's user avatar
  • 3,007
0 votes
1 answer
18 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&...
masoud nkh's user avatar
0 votes
1 answer
199 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 ...
Peter K.'s user avatar
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 ...
pixelngrain's user avatar
  • 1,370
0 votes
1 answer
13 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 ...
NextGenThemes's user avatar
1 vote
0 answers
1k 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 ...
itsoft3g's user avatar
  • 111
0 votes
1 answer
32 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 ...
Skymonkey's user avatar
0 votes
1 answer
39 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: ...
SkyRar's user avatar
  • 203
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
  • 454
1 vote
1 answer
170 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,...
henrywright's user avatar
  • 3,007
0 votes
2 answers
114 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 ...
DevelJoe's user avatar
  • 435
0 votes
1 answer
404 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, ...
Will Ashworth's user avatar
1 vote
1 answer
390 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 ...
Cebbi's user avatar
  • 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 ...
Mark's user avatar
  • 1,019
0 votes
1 answer
62 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 ...
micahmills's user avatar
1 vote
1 answer
249 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-...
Marc's user avatar
  • 645
0 votes
1 answer
136 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 ...
wittich's user avatar
  • 173
0 votes
1 answer
60 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 ...
Ingo Steinke's user avatar

1
2 3 4 5
8