Skip to main content
26 votes

Can't change language (only "English (United States)")

Maybe WordPress doesn't have permissions to save the new language files. I had the same problem, and I solved it by adding the following to wp-config.php define('FS_METHOD', 'direct'); You might ...
Hans Westman's user avatar
13 votes

Can't change language (only "English (United States)")

I have no experience with WP before. I tried to install WP 4.7 and have same problem. Only English was in dropdown list. I thought WP downloads all translate files automaticall but unfortunately it ...
Alexey Muravyov's user avatar
9 votes
Accepted

How can I uninstall a language?

I hope you have FTP access or some alike, so you can follow path as shown below. Use any FTP tool (FileZilla or some) and enter your website. 1) Go to the wp-content folder There you will see a ...
Jerry.S's user avatar
  • 140
8 votes

How to change the language for the front-end only?

Well, you actually do not need anything special to have two different languages in the back end and in the front end. I just tested it again on WP 5.1 go to the settings and set the Site Language to ...
Simeon's user avatar
  • 81
7 votes

Can't change language (only "English (United States)")

Just ran into the same issue. In my case, the reason was simple. When you install an English-only version of WordPress, there is no languages subdirectory under the wp-content directory. Create it ...
Ivan Shatsky's user avatar
6 votes

How can I uninstall a language?

In order to reset to English only? You will have to remove all files in these folders: /wp-content/languages /wp-content/languages/plugins /wp-content/languages/themes Remember that your default ...
Dealazer's user avatar
6 votes

Edit plugin without hooks in functions.php

There is a filter you can use, but it is well hidden. Take a look at the WordPress function __. As you can see it calls another function, translate. And there it is, a filter called gettext. You can ...
cjbj's user avatar
  • 14.6k
5 votes

How to use load_plugin_textdomain from within a theme

It seems there is no easy way to do this as load_plugin_textdomain() won't work as expected when called from a child theme. A generic workaround was developed by Marius Vetrici but I've found it to ...
Alpi Murányi's user avatar
5 votes

How to change the language for the front-end only?

If anyone is still looking for that, here is what you should do since version 4.7 function wp_noshor_redefine_locale($locale) { if( is_admin() ): switch_to_locale('en_US'); endif; } ...
Motaz M. El Shazly's user avatar
5 votes
Accepted

Add language/country code to each possible URL

I'm working on a similar solution right now - the website must have language codes in all URLs (except the default language), but only pages are translatable in a way WPML/Polylang plugins do it. For ...
Ihor Vorotnov's user avatar
5 votes

Changing the language of a single page

The locale filter that allows you to set the locale specifically. You can check the current page, and alter the value based on that. add_filter('locale', 'change_my_locale'); function ...
Johansson's user avatar
  • 15.3k
5 votes

Wordpress theme with frontend in different language than backend?

Since v 4.7, WP has a User specific language setting for admin area. You can find language field under Users>Your profile.
idpokute's user avatar
  • 377
4 votes

Multisite use language code as subdirectory

Here's a proper multisite solution: Install WordPress directly on the root of your domain mysite.de. After that, setup a multisite and chose the subdomain option (Yes, subdomain! It's far more ...
David's user avatar
  • 3,275
4 votes

Override default WordPress core translation

I was about to use the "add_filter( 'gettext'..." solution suggested above but then read at https://developer.wordpress.org/reference/hooks/gettext/ that this solution can have quite a ...
GoldyOnline's user avatar
4 votes

Changing the language of a single page

You should use locale hook to solve your task. Important note that you can't add it in theme and use is_page function, because it will define later. So you have to create plugin or must use plugin ...
Anton Lukin's user avatar
4 votes
Accepted

`wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin

Ok, a simple change dirname(plugin_basename(__FILE__)) . '/languages/' inside wp_set_script_translations() function (3rd argument) to plugin_dir_path(__FILE__) . 'languages/' fixed the problem
kanlukasz's user avatar
  • 504
3 votes

How to get a translated string from a language other than the current one?

To find the answer to this question, you just need to look at how WordPress retrieves the translations. Ultimately it is the load_textdomain() function that does this. When we take a look at its ...
J.D.'s user avatar
  • 3,915
3 votes

load_theme_textdomain path

After some more reseach, I found load_textdomain function which can help to load .mo file from any location. load_textdomain($domain, $mofile);
user3631047's user avatar
3 votes

Edit plugin without hooks in functions.php

Editing other plugins' or themes' files that don't have proper hooks or filters is complicated. Changing text that is going to be translated is not. Try using a plugin such as Loco translate, you ...
kero's user avatar
  • 6,220
3 votes
Accepted

How can I redirect a request to the site root using htaccess, if there's not a specific cookie set?

if the cookie “language_known” isn't set to the value “yes”. RewriteCond %{HTTP_COOKIE} !language_known=true;? [NC] The condition is checking that the value is not "true" (string), not &...
MrWhite's user avatar
  • 3,881
2 votes

Can a plugin be run in a different language than WordPress?

// to force use English, this filter value must return true. add_filter('override_load_textdomain', 'myPlugin_OverrideLoadTextDomain', 10, 3); add_filter('plugin_locale', '...
vee's user avatar
  • 231
2 votes

Can't change language (only "English (United States)")

This problem is occurred in WordPress 4.0 and above versions also , because of permissions. Because of this WordPress cannot download the language packs. To add other languages in admin panel general ...
Archana Sharma's user avatar
2 votes

Override default WordPress core translation

It's also possible to use get_the_archive_title filter in your functions.php: function archive_title_modify( $title ) { return str_replace('Categorie: ', 'Sectie: ', $title); } add_filter('...
Maciej Łoziński's user avatar
2 votes
Accepted

How to find a language direction?

The text_direction property of the WP_Locale class defaults to 'ltr' as per it's declaration, then may be modified in the class's init() initialization function in wp-includes/locale.php (near line #...
bosco's user avatar
  • 6,825
2 votes
Accepted

Language Translation is not working?

Check the following function in your plugin: load_plugin_textdomain (); and be sure that the directory to languages folder is correct. This fixed the issue for above question.
HOY's user avatar
  • 291
2 votes
Accepted

How to set locale in ajax requests?

(this kind of issues is part of why my standard recommendation is to not have front end with two languages) The core reason to the problem is that your ajax returns text. AJAX should be treated like ...
Mark Kaplun's user avatar
  • 23.4k
2 votes

"Select your country" landing page. Remember user choice

I recently had to implement a similar solution and decided to build it from the ground up. It is quite an involved task and if you are not sure how to do it, I would suggest you try a plugin first (a ...
onebc's user avatar
  • 184
2 votes

'Trick' a plugin (WP-Members) to think the blog language has changed for a single page

Yes, sort of. Any localized plugin such as WP-Members runs off of the "locale" that WordPress is set to. This value can be filtered for WP as a whole using the locale filter. But it can also be ...
butlerblog's user avatar
  • 5,006
2 votes
Accepted

Is it possible to set a different frontend- and backend-language?

You can set the site language to whatever you wish in the Settings > General > Site Language. After that, you can head over to your profile and choose a language for the back-end. To do so, ...
Johansson's user avatar
  • 15.3k
2 votes

Changing the language of a single page

I needed something similar for translation & direction purposes. By defining $direction for each post, 'ltr' or 'rtl'...using this simple plugin ... I edited the plugin by adding following action ...
Kenan Hodzic's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible