[js-embedded-discovery] branch master updated: EDS-72 Allow specification of the display language as a config parameter

Rod Widdowson rdw at steadingsoftware.com
Sat Mar 14 09:25:31 EDT 2020


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch master
in repository js-embedded-discovery.

View the commit online:
http://git.shibboleth.net/view/?p=js-embedded-discovery.git;a=commit;h=db2a6bd7a07c479c72552c39b34c5a3f0be718be

The following commit(s) were added to refs/heads/master by this push:
       new  db2a6bd   EDS-72 Allow specification of the display language as a config parameter
db2a6bd is described below

commit db2a6bd7a07c479c72552c39b34c5a3f0be718be
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Mon Mar 9 10:39:14 2020 +0000

    EDS-72 Allow specification of the display language as a config parameter
    
    https://issues.shibboleth.net/jira/browse/EDS-72
---
 src/javascript/idpselect.js        | 4 +++-
 src/javascript/idpselect_config.js | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/javascript/idpselect.js b/src/javascript/idpselect.js
index a1647cb..9d8a14c 100644
--- a/src/javascript/idpselect.js
+++ b/src/javascript/idpselect.js
@@ -196,7 +196,9 @@ function IdPSelectUI() {
 
         var lang;
 
-        if (typeof navigator == 'undefined') {
+        if (paramsSupplied.selectedLanguage != null) {
+            lang = paramsSupplied.selectedLanguage;
+        } else if (typeof navigator == 'undefined') {
             lang = paramsSupplied.defaultLanguage;
         } else {
             lang = navigator.language || navigator.userLanguage || paramsSupplied.defaultLanguage;
diff --git a/src/javascript/idpselect_config.js b/src/javascript/idpselect_config.js
index f425219..5c21fc5 100644
--- a/src/javascript/idpselect_config.js
+++ b/src/javascript/idpselect_config.js
@@ -1,4 +1,3 @@
- 
 /** @class IdP Selector UI */
 function IdPSelectUIParms(){
     //
@@ -7,6 +6,8 @@ function IdPSelectUIParms(){
     this.alwaysShow = true;          // If true, this will show results as soon as you start typing
     this.dataSource = '/Shibboleth.sso/DiscoFeed';   // Where to get the data from
     this.defaultLanguage = 'en';     // Language to use if the browser local doesnt have a bundle
+    this.selectedLanguage = null;    // Set this to override the browser default (for instance if you can
+                                     // detect this from the URL.
     this.defaultLogo = 'blank.gif';  // Replace with your own logo
     this.defaultLogoWidth = 1;
     this.defaultLogoHeight = 1 ;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list