Sophivorus has submitted this change and it was merged.

Change subject: Distinguish between content language and user language
......................................................................


Distinguish between content language and user language

Interface language should be based on the user language,
but the language of the labels and parameters on the content
language.

Change-Id: I2c4b450204bc270b26f271772b1c0c4ff68b9d6a
---
M proveit.css
M proveit.js
2 files changed, 20 insertions(+), 4 deletions(-)

Approvals:
  Sophivorus: Verified; Looks good to me, approved



diff --git a/proveit.css b/proveit.css
index a04a98a..e809606 100755
--- a/proveit.css
+++ b/proveit.css
@@ -74,15 +74,18 @@
 }
 
 #proveit-reference-list .proveit-reference-item .proveit-reference-number {
+       font-weight: bold;
        margin-right: 10px;
 }
 
 #proveit-reference-list .proveit-reference-item .proveit-reference-template {
        font-weight: bold;
+       margin-right: 10px;
 }
 
 #proveit-reference-list .proveit-reference-item .proveit-param-value {
-       margin-left: 10px;
+       display: inline-block;
+       margin-right: 10px;
 }
 
 #proveit-reference-list .proveit-reference-item .proveit-citations {
diff --git a/proveit.js b/proveit.js
index fac1f5c..9502207 100755
--- a/proveit.js
+++ b/proveit.js
@@ -86,6 +86,13 @@
        userLanguage: 'en',
 
        /**
+        * Content language (may be different from the user language)
+        *
+        * @type {string} defaults to English
+        */
+       contentLanguage: 'en',
+
+       /**
         * Convenience method to get a ProveIt option
         *
         * @param {string} option key without the "proveit-" prefix
@@ -126,7 +133,13 @@
                if ( userLanguage in proveit.messages ) {
                        proveit.userLanguage = userLanguage;
                }
-               mw.messages.set( proveit.messages[ userLanguage ] );
+               mw.messages.set( proveit.messages[ proveit.userLanguage ] );
+
+               // Set the content language
+               var contentLanguage = mw.config.get( 'wgContentLanguage' );
+               if ( contentLanguage ) {
+                       proveit.contentLanguage = contentLanguage;
+               }
 
                // Build the interface
                proveit.build();
@@ -932,7 +945,7 @@
 
                                // Override with template data
                                if ( paramData.label ) {
-                                       paramLabel = paramData.label[ 
proveit.userLanguage ];
+                                       paramLabel = paramData.label[ 
proveit.contentLanguage ];
                                }
 
                                // If the parameter is a date, put the current 
date as a placeholder
@@ -946,7 +959,7 @@
                                }
 
                                if ( paramData.description ) {
-                                       paramDescription = 
paramData.description[ proveit.userLanguage ];
+                                       paramDescription = 
paramData.description[ proveit.contentLanguage ];
                                }
 
                                // Extract the parameter value

-- 
To view, visit https://gerrit.wikimedia.org/r/316072
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2c4b450204bc270b26f271772b1c0c4ff68b9d6a
Gerrit-PatchSet: 1
Gerrit-Project: wikipedia/gadgets/ProveIt
Gerrit-Branch: master
Gerrit-Owner: Sophivorus <scheno...@gmail.com>
Gerrit-Reviewer: Sophivorus <scheno...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to