Update setlang to display confirmation dialog to change language

setlang will now display a dialog to confirm with the user that
they would like to change their interface language. The preferred
language will only be updated if the user confirms.

The dialog will be displayed if the setlang parameter is present in
the query string and,

* A user is logged in, and their preferred language is not the same
  as the one passed via setlang.
* For an anonymous user if the wgULSAnonCanChangeLanguage is true,
  and the current interface language is not the same as the one
  passed via setlang.

Bug: T63115
Change-Id: I882297d99a594fd82fd0aec3b4664e8bfd1eac3a
This commit is contained in:
Abijeet
2019-11-20 03:50:45 +05:30
committed by jenkins-bot
parent 88b2f8ee2f
commit ff02e63a45
11 changed files with 437 additions and 40 deletions

View File

@@ -19,5 +19,9 @@
"apihelp-ulslocalization-summary": "Get the localization of ULS in the given language.",
"apihelp-ulslocalization-param-language": "Language code.",
"apihelp-ulslocalization-example-1": "Get Tamil localization",
"apihelp-ulslocalization-example-2": "Get Hindi localization"
"apihelp-ulslocalization-example-2": "Get Hindi localization",
"apihelp-ulssetlang-description": "Update user's preferred interface language.",
"apihelp-ulssetlang-summary": "Update user's preferred interface language.",
"apihelp-ulssetlang-param-languagecode": "The preferred language code.",
"apierror-ulssetlang-anon-notallowed": "Anonymous users are not allowed to change the interface language."
}

View File

@@ -18,5 +18,9 @@
"apihelp-ulslocalization-summary": "{{doc-apihelp-summary|ulslocalization}}",
"apihelp-ulslocalization-param-language": "{{doc-apihelp-param|ulslocalization|language}}\n{{Identical|Language code}}",
"apihelp-ulslocalization-example-1": "{{doc-apihelp-example|ulslocalization}}",
"apihelp-ulslocalization-example-2": "{{doc-apihelp-example|ulslocalization}}"
"apihelp-ulslocalization-example-2": "{{doc-apihelp-example|ulslocalization}}",
"apihelp-ulssetlang-description": "{{doc-apihelp-description|ulssetlang}}",
"apihelp-ulssetlang-summary": "{{doc-apihelp-summary|ulssetlang}}",
"apihelp-ulssetlang-param-languagecode": "{{doc-apihelp-param|ulssetlang|languagecode}}",
"apierror-ulssetlang-anon-notallowed": "{{doc-apierror}}"
}

View File

@@ -65,5 +65,12 @@
"ext-uls-compact-link-info": "All languages (initial selection from common choices by you and others)",
"prefs-languages": "Languages",
"ext-uls-compact-language-links-preference": "Use a [[$1|compact language list]], with languages relevant to you.",
"ext-uls-compact-no-results": "This page is not available in the language you searched for."
"ext-uls-compact-no-results": "This page is not available in the language you searched for.",
"ext-uls-setlang-error": "There was an error while updating your preferred language. Error: $1",
"ext-uls-setlang-unknown-error": "Unknown error",
"ext-uls-setlang-message": "The link you followed requested the interface to be shown in <strong>$1 ($2)</strong>",
"ext-uls-setlang-heading": "Change interface language?",
"ext-uls-setlang-accept": "Accept change",
"ext-uls-setlang-loading": "Applying...",
"ext-uls-setlang-cancel": "Don't change"
}

View File

@@ -69,5 +69,12 @@
"ext-uls-compact-link-info": "A tooltip for a button that shows all available languages next to a short list of relevant languages.",
"prefs-languages": "Field set legend for user preferences regarding display of language lists\n{{Identical|Language}}",
"ext-uls-compact-language-links-preference": "Label for compact language links user preference",
"ext-uls-compact-no-results": "Message shown when the language search does not have any results."
"ext-uls-compact-no-results": "Message shown when the language search does not have any results.",
"ext-uls-setlang-error": "Error message shown to the user when saving the preferred language fails. Parameters:\n* $1 - Error information from the API. If none provided, then {{msg-mw|ext-uls-setlang-unknown-error}} is shown.",
"ext-uls-setlang-unknown-error": "Error message shown when the API does not return error information. \n\nPreceded by the notification message {{msg-mw|ext-uls-setlang-error}}.",
"ext-uls-setlang-message": "Message shown to the user on the set language preference dialog. Parameters:\n* $1 - Language name\n* $2 - Language code",
"ext-uls-setlang-heading": "Message shown as heading to the user on the set language preference dialog. Parameters:\n* $1 - Language name",
"ext-uls-setlang-accept": "Button label for accepting the suggested language in language preference dialog.",
"ext-uls-setlang-loading": "Button label displayed while the API call is in progress after the user clicks on the accept button. See {{msg-mw|ext-uls-setlang-accept}}.",
"ext-uls-setlang-cancel": "Button label for cancel on the language preference dialog."
}