Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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

WordPress Plugin translation not working EN To FR

I'm creating a new plugin actually, the plugin is working perfectly, but it's not available yet in the wordpress.org website, I have an issue with the translation, I will not use wordpress.org for the ...
Sam94's user avatar
  • 3
0 votes
0 answers
35 views

Localize javascript files for translation

I have several javascript files added to a child theme. I need to localiza those scripts in order to make them a vailable to treanaslation to other languages. I've already done it for the php files. ...
GKaplan's user avatar
0 votes
1 answer
131 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 (...
LinasK's user avatar
  • 1
-2 votes
1 answer
161 views

How to retrieve blog language without any region (locale) attached?

How can you retrieve the language of a WordPress website, without the added region suffix attached to it? In other words, just get the language, without the entire locale. E.g. <html lang="en&...
Jesse Nickles's user avatar
0 votes
1 answer
47 views

Plugin Internationalisation and textdomain

I have developed seven Wordpress plugins for a new project as I was not able to find anything that currently supported these features. Three of them have interest from other users and one of those ...
Walrus's user avatar
  • 131
0 votes
0 answers
67 views

Does wp i18n CLI has a prototype of "update-json" file?

I correctly internationalized a javascript file from wp theme folder. Now I would like to know if Wordpress team plans to propose a CLI to update json without losing existing translation. It seems ...
imagIne's user avatar
  • 83
3 votes
1 answer
401 views

Javascript localization doesn't load. How to Internationalize javascript without plugin?

The internationalisation of my theme is defined in functions.php and the javascript file to be internationalised uses the wp-i18n library. The translation function __('string',text-domain'); is ...
imagIne's user avatar
  • 83
0 votes
0 answers
23 views

Localization PHP: How can I scan the theme to detect the addition of a new string to be internationalized?

In my theme I added "languages" folder (my-theme/languages/)and in my global css file I have well the text domain. I work only with php internationalization (no javascript). I don't use ...
imagIne's user avatar
  • 83
1 vote
1 answer
111 views

Why does WordPress not make use of gettext directly?

When you develop WordPress plugins and internationalize them, the official WP docs instruct you to use gettext, by generating the according .po and .mo files. When your .mo files are however put to ...
DevelJoe's user avatar
  • 487
0 votes
0 answers
30 views

How do I output translated text strings on edit screens

I want to output a localized text string above the post/page listing table (edit.php). Everything seems to work except that the string will only be in English (original string, not the translated one)....
lepardman's user avatar
  • 315
1 vote
0 answers
25 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
-1 votes
2 answers
1k 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
  • 487
1 vote
0 answers
47 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
1 vote
1 answer
268 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
  • 35
2 votes
1 answer
490 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
  • 35
0 votes
1 answer
131 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
1 answer
38 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
7 votes
4 answers
1k 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
183 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
50 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
178 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
162 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
36 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
87 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,121
3 votes
1 answer
533 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
  • 717
0 votes
0 answers
61 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
2k 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
110 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
64 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
28 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
  • 487
0 votes
2 answers
664 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
  • 487
1 vote
0 answers
188 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
42 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
251 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
345 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,067
0 votes
1 answer
26 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
777 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 ...
James B.'s user avatar
0 votes
1 answer
15 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,400
0 votes
1 answer
20 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
62 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
46 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
  • 202
4 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
  • 504
1 vote
1 answer
315 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,067
0 votes
1 answer
121 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
  • 487
0 votes
1 answer
502 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
2 votes
2 answers
705 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
  • 123
3 votes
3 answers
2k 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
76 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
2 3 4 5
8