Langue différente pour le frontend et le backend
7 réponses
- votes
-
- 2011-08-27
Vouspouvezeffectuer les opérations suivantes:
- Obtenez lemodule linguistique (parexemple,
de_DE.mo
) sur wordpress.org .Si lepack de languen'estpas disponibleen téléchargement autonome,vouspouvez également utiliser lefichier.mo
quiestfourni dans lefichier ZIP WordPresspour votre langue.Situé souswp-content/languages
. - Déplacez lefichier
.mo
verswp-content/languages/
de votreinstallation WordPresspar défaut (anglais). - Remplacez la constante
WPLANG
dewp-config.php
par lanouvelle locale (parexemple,de_DE
) - Dans votre
functions.php
ajoutez lefiltre suivant:
add_filter('locale', 'wpse27056_setLocale'); function wpse27056_setLocale($locale) { if ( is_admin() ) { return 'en_US'; } return $locale; }
You can do the following:
- Get the the language pack (e.g.
de_DE.mo
) from wordpress.org. If the language pack isn't available as a standalone download, you could also use the.mo
file which is bundled in the WordPress ZIP-file for your language. Located underwp-content/languages
. - Move the
.mo
file towp-content/languages/
of your default (english) WordPress installation. - Change the
WPLANG
constant inwp-config.php
to the new locale (e.g.de_DE
) - In your
functions.php
add the following filter:
functions.php
add_filter('locale', 'wpse27056_setLocale'); function wpse27056_setLocale($locale) { if ( is_admin() ) { return 'en_US'; } return $locale; }
-
maintenant,qu'entendez-vouspar «installer votremodule linguistique»?dois-je désinstaller le wordpresset installer lenouveau wordpress,mais disonsfrançais?Jene veuxpas désinstallermon wordpress anglais.now, what do you mean by "install your language pack"? should I uninstall the wordpress, and install the new wordpress, but say French? I don't want to uninstall my English wordpress.
- 0
- 2011-09-02
- serhio
-
Non,vousn'avez rien à réinstaller.Téléchargez simplement WP dans la langue de votre choix,copiez lefichier de langue de `wp-content/languages/` vers votreinstallation WPen anglais d'origineet modifiez `wp-config.php` comme décrit ci-dessus.Outéléchargez simplement lefichier `fr_FR.mo` depuis [ce site] (http://www.wordpress-fr.net/telechargements/).No, you don't have to reinstall anything. Just download WP in your desired language an copy the language file from `wp-content/languages/` to your original english WP install and modify `wp-config.php` as described above. Or just download the `fr_FR.mo` file from [this site](http://www.wordpress-fr.net/telechargements/).
- 1
- 2011-09-02
- rofflox
-
Jen'avaispas le dossier `wp-content/languages/`,doncje devrais le créer.Après avoireffectué cettemanipulation,j'ai le vice-versa de ce queje ferais.J'aimaintenant lepanneau d'administrationen roumain,mais lapage (même connectée ounon) -en anglais.Je devraispeut-êtretraduire lethème ...I had not the `wp-content/languages/` folder, so I should create it. After performing that manipulation, I has the vice-versa of what I would. I have now the admin panel in Romanian, but the page (even logged or not) - in English. Perhaps I should translate the theme...
- 0
- 2011-09-07
- serhio
-
Bien sûr,vous deveztraduire lethème.Mais lebackend doit êtreen anglaiset nonen roumain si vous définissez `is_admin ()` dans lefiltre ci-dessus.Of course, you need the theme translated. But the backend should be in English not Romanian if you set `is_admin()` in the filter above.
- 0
- 2011-09-07
- rofflox
-
J'ai ajouté ce code à lafin dufichierfunctions.php duthème actuel (vingt-dix) ... Est-ce correct?I added this code at the end of the functions.php file of the current (twenty ten) theme... Is that correct?
- 0
- 2011-09-07
- serhio
-
Jep ..ne fonctionnepas?Despluginsinstallés?Jep.. doesn't work? Any plugins installed?
- 0
- 2011-09-07
- rofflox
-
J'ai du codebasé sur ceci,lemettre dans unthème `functions.php`ne fonctionnerapas carilesttroptard.Je l'aiplacé dans unmu-pluginet j'ai vu des résultats considérablement améliorés.I have code based on this, putting it in a themes `functions.php` isn't going to work as it's too late. I placed it in an mu-plugin and saw vastly improved results.
- 0
- 2014-04-16
- Tom J Nowell
-
çane marchepasthis doesn't work
- 0
- 2015-11-19
- younes0
-
n'apasfonctionnépourmoinonplus.didn't work for me either.
- 0
- 2015-12-13
- wesamly
-
voir aussima réponse ci-dessouspour WordPress v>=4.7,quipermet aux utilisateurs de voir lebackend dans leurpropre languesee also my answer bellow for the WordPress v >= 4.7, that allows users to see the Backend in their own language
- 1
- 2018-08-14
- Serge
-
- 2018-08-14
Depuis la version 4.7 de WordPress ,différents utilisateurs dubackend peuvent définir leur propre langue d'administrationpréférée en utilisant le natif WordPresssélecteur de langue.De cettefaçon,ils voient l'interface WordPress dans leur langueet peuventgérerplusfacilement le contenu.
-
Le code définit quepourtous les utilisateurs dumondeentier,celane fonctionne que sur un compteindividuel.The code sets that for all users globally, this works only on an individual account.
- 0
- 2019-12-18
- Motaz M. El Shazly
-
- 2012-10-06
Vouspouvez utiliser despluginspour cela: http://wordpress.org/extend/plugins/kau-boys-backend-localisation/ ou http://wordpress.org/extend/plugins/wp-native-dashboard/
You can use plugins for that: http://wordpress.org/extend/plugins/kau-boys-backend-localization/ or http://wordpress.org/extend/plugins/wp-native-dashboard/
-
Bienvenue surnotre site.Veuillez ajouter uneexplication: Quefont cesplugins,quelles sont les différences?Welcome to our site. Please add an explanation: What do these plugins, what are the differences?
- 1
- 2012-10-06
- fuxia
-
Jepense qu'il y aexactement lamême chose.(J'utilisejuste lepremier ...) Vouspouvezinstaller différentsfichiers de langueet avec lesplugins,vouspouvez changer la langue dubackendindépendamment.Les deuxpluginsfournissent des commutateurs detableau debordpour la langue,uneboîte de sélection de la langue de connexionet unmodule complémentaire à lapage deprofilpour la langue spécifique à l'utilisateur.I think there are doing exactly the same. (I just use the first one...) You can install different language files and with the plugins you can change the language for the backend independently. Both plugins provide Dashboard switches for the language, a login language select box and an add-on to the profile page for user-specific language.
- 1
- 2012-10-08
- zodiac1978
-
- 2018-04-07
Si quelqu'unesttoujours à la recherche de cela,voici ce que vous devezfaire depuis la version 4.7
function wp_noshor_redefine_locale($locale) { if( is_admin() ): switch_to_locale('en_US'); endif; } add_filter('init','wp_noshor_redefine_locale');
Cela oblige letableau debord à se chargeren anglais,puis vouspouvez accéder auxparamètres,définir la langue que vous désirez.
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; } add_filter('init','wp_noshor_redefine_locale');
This forces the dashboard to load in English, then you can go to settings, set the language you desire.
-
- 2019-06-10
Dans WordPress 5.x,ilesttrès simple d'obtenir une langue defrondeet d'arrière-plan différente
Pour changer la langue du site,allez dans Paramètres -> Général -> Langue du siteet sélectionnez la langue du site.
Pour lepanneau d'administration,allez aux utilisateurs -> Votreprofilet sélectionnez la langue que vous voulez avoir sur lepanneau d'administration
Donctoutes les solutions ci-dessus sont devenues absolues,chaque utilisateurpeut définir sapropre languepour l'interface WordPress
In the WordPress 5.x it real simple to get a different frond and back end language
To change the site language go to Setting -> General -> Site Language and select the site language.
For the Admin Panel goto Users -> Your Profile and select the language you want to have on the Admin Panel
So all the above solutions have become absolute, each user can set their own language for the WordPress interface
-
Cela devrait être la réponse choisiepour 2019+.Aucunplug-in requiset la solutionest si simple.Je vous remercie!This should be the selected answer for 2019+. No plugins required and the solution is so simple. Thank you!
- 0
- 2019-12-04
- stason
-
Cela changepour chaque utilisateurindividuellement,le code le changera automatiquementpourtous les utilisateurs.This change it per each user individually, the code will change it automatically to all users.
- 0
- 2019-12-18
- Motaz M. El Shazly
-
- 2016-08-08
Une réponsemise àjourpour Wordpress 4+
Laréponse de @ rofflox esttoujours correcte,mais certainesmodifications apportées à Wordpresspeuvent avoir uneffet lorsqueen utilisant safonction «telle quelle» depuis WP 4.0.
La constante wp-config
WPLANG
est obsolète en faveur duparamétrage de la langue du site via une liste déroulante dansSettings->General
. Cela signifie qu'après avoir changé la langue de votre siteen Svenka (parexemple),l'administrateur de votre site apparaîtra en anglais ...mais cette liste déroulante Langue du site dansSettings->General
seraprésélectionné comme Anglais (États-Unis) . Cela signifie que si vousmodifiez ultérieurement vosparamètresgénérauxet que vous oubliez de sélectionner ànouveau Svenka comme langue de votre site,l'ensemble du site reviendra à l'anglais.Je recommanderais de créer desfonctions dans votrefichier
functions.php
comme ceci:// Set the locale; original function from @rofflox function vnmFunctionality_setLocale($locale) { if (is_admin()) { return 'en_US'; } return $locale; } add_filter('locale', 'vnmFunctionality_setLocale'); // Enqueue a script to force-set the Language dropdown on the General Options page, just in case we forget about it later. function vnmFunctionality_countryReminderScript($hook) { if ($hook != 'options-general.php') { return; } wp_enqueue_script('lang-reminder-script', get_template_directory() . '/js/site-language.js', array('jquery'), '1.0.0', true); wp_localize_script('lang-reminder-script', 'langObject', array( 'lang' => get_option('WPLANG'), )); } add_action('admin_enqueue_scripts', 'vnmFunctionality_countryReminderScript');
Etpuis unfichier Javascript appelé
site-language.js
(enregistré dans un dossier/js/
dans votrethème) comme ceci:jQuery(document).ready(function($) { $('select#WPLANG').val(langObject.lang).change(); });
Cela devrait automatiquementprésélectionner la langue d'affichage actuelle du site dans la liste déroulante de lapage Options,afin que vousn'ayezpas à vous rappeler de lefairemanuellement à chaquefois.
An updated answer for Wordpress 4+
@rofflox's answer is still correct, but there have been some changes to Wordpress that can have an effect when using his function 'as-is' since WP 4.0.
The wp-config constant
WPLANG
has been deprecated in favour of setting the site language via a dropdown inSettings->General
. This means that, after changing your site's language to Svenka (for example), your site's admin will appear in English... but that Site Language dropdown inSettings->General
will be pre-selected as English (United States). That means that, if you make changes to your General settings later on and forget to pick Svenka as your site's language again, the whole site will revert back to English.I would recommend creating functions in your
functions.php
file like so:// Set the locale; original function from @rofflox function vnmFunctionality_setLocale($locale) { if (is_admin()) { return 'en_US'; } return $locale; } add_filter('locale', 'vnmFunctionality_setLocale'); // Enqueue a script to force-set the Language dropdown on the General Options page, just in case we forget about it later. function vnmFunctionality_countryReminderScript($hook) { if ($hook != 'options-general.php') { return; } wp_enqueue_script('lang-reminder-script', get_template_directory() . '/js/site-language.js', array('jquery'), '1.0.0', true); wp_localize_script('lang-reminder-script', 'langObject', array( 'lang' => get_option('WPLANG'), )); } add_action('admin_enqueue_scripts', 'vnmFunctionality_countryReminderScript');
And then a Javascript file called
site-language.js
(saved in a/js/
folder in your theme) like so:jQuery(document).ready(function($) { $('select#WPLANG').val(langObject.lang).change(); });
This should automatically pre-select the site's current display language in the dropdown on the Options page, so that you don't have to remember to do it manually every time.
-
- 2011-09-03
Ce dont vous avezbesoin,c'est detraduire votrethème.Si votrethème a unfichier .pot,ilestfacile àtraduire.Suivez simplement les étapes à
http://www.appthemes.com/blog/comment-traduire-un-thème-wordpress/
Sinon,vous devrez éditer lesfichiers dethèmeet changer lesmots à chaqueinstance.
What you need is to translate your theme. If your theme has a .pot file then it is easy to translate. Just follow the steps at
http://www.appthemes.com/blog/how-to-translate-a-wordpress-theme/
Else, you will need to edit the theme files and change the words at each instance.
-
monthème (vingt dix) a le dossier "wp-content/themes/vingtten/languages"et iln'y a qu'unfichier .pot à l'intérieur ...my theme (twenty ten) has the folder "wp-content/themes/twentyten/languages" and there are only a .pot file inside...
- 0
- 2011-09-07
- serhio
J'utilise unpackage WordPressen anglaiset c'esttrèsbien.
Maintenant,j'aimeraistraduire certains éléments dublog (comme «posté sur»,«commentaires»)etc.,mais laissez l'interface dutableau debordintacteen anglais.
Existe-t-il unmécanismepourtraduire uniquement les éléments du site?