Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change user language preference #2

Open
renoirb opened this issue May 11, 2015 · 1 comment
Open

Change user language preference #2

renoirb opened this issue May 11, 2015 · 1 comment

Comments

@renoirb
Copy link

renoirb commented May 11, 2015

use-case:

  1. If a user wants to change his language preference, he should be able to change it from his profile.
  2. If a WordPress admin user wants to change a user language, he should be able to do it from the edit-user view

Patch

Made against xili-language v 2.16.1, in file xili-includes/xl-class-admin.php

From c29697f230ed52ba297f59321f0893bf202916d2 Mon Sep 17 00:00:00 2001
From: Renoir Boulanger <[email protected]>
Date: Sun, 10 May 2015 20:23:25 -0400
Subject: [PATCH] dev-xiligroup/xili-language-plugin#2 proposal

---
 xili-includes/xl-class-admin.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xili-includes/xl-class-admin.php b/xili-includes/xl-class-admin.php
index 80cde41..358ec4a 100644
--- a/xili-includes/xl-class-admin.php
+++ b/xili-includes/xl-class-admin.php
@@ -680,9 +680,9 @@ class xili_language_admin extends xili_language {
        update_user_option( get_current_user_id(), 'user_locale', $locale, true );
    }

-   function select_user_dashboard_locale() {
+   function select_user_dashboard_locale( $wp_user ) {
        $available_languages = $this->available_languages( 'orderby=value' );
-       $selected = $this->admin_side_locale();
+       $selected = get_user_option( 'user_locale', $wp_user->ID );

        ?>
        <tr>
--
2.3.4
@dev-xiligroup
Copy link
Owner

Thanks,
This modification (and others depending of this like fixing languages popup in general settings ) will be inserted in future version 2.18 of xili-language. Be patient.
M.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants