@@ -85,6 +86,16 @@ class Profile extends Component<{
}
value={
}
+ warningMessage={user.lang === interfaceLocale ? '' : (
+
+
+
+ ),
+ }}/>
+ )}
/>
({
user,
+ interfaceLocale: i18n.locale,
}))(Profile);
diff --git a/src/i18n/be.json b/src/i18n/be.json
index 91dd369..4834fa2 100644
--- a/src/i18n/be.json
+++ b/src/i18n/be.json
@@ -177,6 +177,7 @@
"components.profile.disabled": "Не ўключана",
"components.profile.email": "E‑mail:",
"components.profile.enabled": "Уключана",
+ "components.profile.languageIsUnavailableWarning": "The locale \"{locale}\" you've used earlier isn't currently translated enough. If you want to continue using the selected language, please {participateInTheTranslation} of the project.",
"components.profile.mojangPriorityWarning": "Знойдзены акаўнт Mojang з такім жа нікам і, па {rules}, яго ўладальнік мае права патрабаваць аднаўленне кантролю над нікам.",
"components.profile.multiFactorAuth.codePlaceholder": "Увядзіце код сюды",
"components.profile.multiFactorAuth.disable": "Адключыць",
@@ -198,6 +199,7 @@
"components.profile.multiFactorAuth.theAppIsInstalled": "Дадатак устаноўлены",
"components.profile.multiFactorAuth.whenKeyEntered": "Убачыўшы ў дадатку часовы код, перайдзіце да наступнага кроку.",
"components.profile.nickname": "Нік:",
+ "components.profile.participateInTheTranslation": "participate in the translation",
"components.profile.password": "Пароль:",
"components.profile.passwordRequestForm.continue": "Працягнуць",
"components.profile.passwordRequestForm.description": "Каб завершыць, увядзіце пароль ад акаўнта",
diff --git a/src/i18n/en.json b/src/i18n/en.json
index a3c5279..307c981 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -177,6 +177,7 @@
"components.profile.disabled": "Disabled",
"components.profile.email": "E‑mail:",
"components.profile.enabled": "Enabled",
+ "components.profile.languageIsUnavailableWarning": "The locale \"{locale}\" you've used earlier isn't currently translated enough. If you want to continue using the selected language, please {participateInTheTranslation} of the project.",
"components.profile.mojangPriorityWarning": "A Mojang account with the same nickname was found. According to {rules}, account owner has the right to demand the restoration of control over nickname.",
"components.profile.multiFactorAuth.codePlaceholder": "Enter the code here",
"components.profile.multiFactorAuth.disable": "Disable",
@@ -198,6 +199,7 @@
"components.profile.multiFactorAuth.theAppIsInstalled": "App has been installed",
"components.profile.multiFactorAuth.whenKeyEntered": "If a temporary code appears in your two‑factor auth app, then you may proceed to the next step.",
"components.profile.nickname": "Nickname:",
+ "components.profile.participateInTheTranslation": "participate in the translation",
"components.profile.password": "Password:",
"components.profile.passwordRequestForm.continue": "Continue",
"components.profile.passwordRequestForm.description": "To complete action enter the account password",
diff --git a/src/i18n/fr.json b/src/i18n/fr.json
index bf3c215..08b0799 100644
--- a/src/i18n/fr.json
+++ b/src/i18n/fr.json
@@ -177,6 +177,7 @@
"components.profile.disabled": "Désactivée",
"components.profile.email": "E‑mail:",
"components.profile.enabled": "Activer",
+ "components.profile.languageIsUnavailableWarning": "The locale \"{locale}\" you've used earlier isn't currently translated enough. If you want to continue using the selected language, please {participateInTheTranslation} of the project.",
"components.profile.mojangPriorityWarning": "Un compte Mojang avec le même pseudo a été trouvé. Selon les {rules}, le propriétaire du compte a le droit d'exiger la restauration du contrôle sur le surnom.",
"components.profile.multiFactorAuth.codePlaceholder": "Entrez le code ici",
"components.profile.multiFactorAuth.disable": "Désactiver",
@@ -198,6 +199,7 @@
"components.profile.multiFactorAuth.theAppIsInstalled": "L'application a été installé",
"components.profile.multiFactorAuth.whenKeyEntered": "If a temporary code appears in your two‑factor auth app, then you may proceed to the next step.",
"components.profile.nickname": "Surnom:",
+ "components.profile.participateInTheTranslation": "participate in the translation",
"components.profile.password": "Mot de passe:",
"components.profile.passwordRequestForm.continue": "Continuer",
"components.profile.passwordRequestForm.description": "Pour compléter cette action, entrez le mot de passe du compte",
diff --git a/src/i18n/id.json b/src/i18n/id.json
index c45c098..e2ecb02 100644
--- a/src/i18n/id.json
+++ b/src/i18n/id.json
@@ -177,6 +177,7 @@
"components.profile.disabled": "Dinonaktifkan",
"components.profile.email": "E‑mail:",
"components.profile.enabled": "Diaktifkan",
+ "components.profile.languageIsUnavailableWarning": "The locale \"{locale}\" you've used earlier isn't currently translated enough. If you want to continue using the selected language, please {participateInTheTranslation} of the project.",
"components.profile.mojangPriorityWarning": "Mojang akun dengan nickname yang sama di temukan. Sesuai dengan {rules}, pemilik akun dapat mengambil kontrol dengan nickname-nya.",
"components.profile.multiFactorAuth.codePlaceholder": "Masukkan kodenya disini",
"components.profile.multiFactorAuth.disable": "Nonaktifkan",
@@ -198,6 +199,7 @@
"components.profile.multiFactorAuth.theAppIsInstalled": "Aplikasi telah diunduh",
"components.profile.multiFactorAuth.whenKeyEntered": "Jika kode sementara muncul di aplikasi otorisasi dua-faktor anda, anda boleh lanjut ke tahap berikutnya.",
"components.profile.nickname": "Nama panggilan:",
+ "components.profile.participateInTheTranslation": "participate in the translation",
"components.profile.password": "Kata sandi:",
"components.profile.passwordRequestForm.continue": "Lanjut",
"components.profile.passwordRequestForm.description": "Untuk menyelesaikan, masukan kata sandi",
diff --git a/src/i18n/lt.json b/src/i18n/lt.json
index 1d64403..a655ba8 100644
--- a/src/i18n/lt.json
+++ b/src/i18n/lt.json
@@ -177,6 +177,7 @@
"components.profile.disabled": "Išjungtas",
"components.profile.email": "El.Paštas:",
"components.profile.enabled": "Įjungtas",
+ "components.profile.languageIsUnavailableWarning": "The locale \"{locale}\" you've used earlier isn't currently translated enough. If you want to continue using the selected language, please {participateInTheTranslation} of the project.",
"components.profile.mojangPriorityWarning": "Buvo rasta Mojang paskyra su tuo pačiu slapyvardžiu. Pagal {rules}, paskyros savininkas turi teisę reikalauti atkurti slapyvardžio kontrolę.",
"components.profile.multiFactorAuth.codePlaceholder": "Įveskite kodą čia",
"components.profile.multiFactorAuth.disable": "Išjungti",
@@ -198,6 +199,7 @@
"components.profile.multiFactorAuth.theAppIsInstalled": "Programa įdiegta",
"components.profile.multiFactorAuth.whenKeyEntered": "Jei dviejų veiksmų programoje pasirodo laikinas kodas, galite pereiti prie kito žingsnio.",
"components.profile.nickname": "Slapyvardis:",
+ "components.profile.participateInTheTranslation": "participate in the translation",
"components.profile.password": "Slaptažodis:",
"components.profile.passwordRequestForm.continue": "Tęsti",
"components.profile.passwordRequestForm.description": "Norėdami užbaigti veiksmą įveskite paskyros slaptažodį",
diff --git a/src/i18n/pl.json b/src/i18n/pl.json
index e9efd93..31263ab 100644
--- a/src/i18n/pl.json
+++ b/src/i18n/pl.json
@@ -177,6 +177,7 @@
"components.profile.disabled": "Wyłączone",
"components.profile.email": "E‑mail:",
"components.profile.enabled": "Włączone",
+ "components.profile.languageIsUnavailableWarning": "The locale \"{locale}\" you've used earlier isn't currently translated enough. If you want to continue using the selected language, please {participateInTheTranslation} of the project.",
"components.profile.mojangPriorityWarning": "Znaleziono konto Mojang z tym samym nickiem. Zgodnie z {rules} właściciel konta ma prawo żądać przywrócenia kontroli nad pseudonimem.",
"components.profile.multiFactorAuth.codePlaceholder": "Wprowadź tutaj kod",
"components.profile.multiFactorAuth.disable": "Wyłącz",
@@ -198,6 +199,7 @@
"components.profile.multiFactorAuth.theAppIsInstalled": "Aplikacja została zainstalowana",
"components.profile.multiFactorAuth.whenKeyEntered": "Jeżeli kod tymczasowy pojawia się w twojej aplikacji uwierzytelniania dwupoziomowego, możesz przejść do następnego kroku.",
"components.profile.nickname": "Nick:",
+ "components.profile.participateInTheTranslation": "participate in the translation",
"components.profile.password": "Hasło:",
"components.profile.passwordRequestForm.continue": "Kontynuuj",
"components.profile.passwordRequestForm.description": "Aby zakończyć działanie, wprowadź hasło konta",
diff --git a/src/i18n/pt.json b/src/i18n/pt.json
index ba20609..ea73279 100644
--- a/src/i18n/pt.json
+++ b/src/i18n/pt.json
@@ -177,6 +177,7 @@
"components.profile.disabled": "Desativado",
"components.profile.email": "E‑mail:",
"components.profile.enabled": "Habilitado",
+ "components.profile.languageIsUnavailableWarning": "The locale \"{locale}\" you've used earlier isn't currently translated enough. If you want to continue using the selected language, please {participateInTheTranslation} of the project.",
"components.profile.mojangPriorityWarning": "Uma conta da Mojang com o mesmo nome foi encontrada. De acordo com as {rules}, o dono desta conta tem o poder de controlar este apelido.",
"components.profile.multiFactorAuth.codePlaceholder": "Digite o código aqui",
"components.profile.multiFactorAuth.disable": "Desabilitar",
@@ -198,6 +199,7 @@
"components.profile.multiFactorAuth.theAppIsInstalled": "Aplicativo instalado",
"components.profile.multiFactorAuth.whenKeyEntered": "Se um código temporário aparece no seu app de aut. em dois fatores, então você pode prosseguir para a próxima etapa.",
"components.profile.nickname": "Apelido:",
+ "components.profile.participateInTheTranslation": "participate in the translation",
"components.profile.password": "Senha:",
"components.profile.passwordRequestForm.continue": "Continuar",
"components.profile.passwordRequestForm.description": "Para completar a ação, coloque a senha da conta",
diff --git a/src/i18n/ru.json b/src/i18n/ru.json
index 83897b9..7fe70a1 100644
--- a/src/i18n/ru.json
+++ b/src/i18n/ru.json
@@ -177,6 +177,7 @@
"components.profile.disabled": "Не включена",
"components.profile.email": "E‑mail:",
"components.profile.enabled": "Включена",
+ "components.profile.languageIsUnavailableWarning": "The locale \"{locale}\" you've used earlier isn't currently translated enough. If you want to continue using the selected language, please {participateInTheTranslation} of the project.",
"components.profile.mojangPriorityWarning": "Найден аккаунт Mojang с таким же ником. Учтите, что согласно с {rules}, его владелец вправе потребовать восстановления контроля над ником.",
"components.profile.multiFactorAuth.codePlaceholder": "Введите сюда код",
"components.profile.multiFactorAuth.disable": "Отключить",
@@ -198,6 +199,7 @@
"components.profile.multiFactorAuth.theAppIsInstalled": "Приложение установлено",
"components.profile.multiFactorAuth.whenKeyEntered": "После того, как вы увидели в приложении временный код, переходите к следующему шагу.",
"components.profile.nickname": "Ник:",
+ "components.profile.participateInTheTranslation": "participate in the translation",
"components.profile.password": "Пароль:",
"components.profile.passwordRequestForm.continue": "Продолжить",
"components.profile.passwordRequestForm.description": "Для завершения, укажите пароль от аккаунта",
diff --git a/src/i18n/sr.json b/src/i18n/sr.json
index 04a2033..8953e21 100644
--- a/src/i18n/sr.json
+++ b/src/i18n/sr.json
@@ -177,6 +177,7 @@
"components.profile.disabled": "онемогућена",
"components.profile.email": "Е-пошта:",
"components.profile.enabled": "омогућена",
+ "components.profile.languageIsUnavailableWarning": "The locale \"{locale}\" you've used earlier isn't currently translated enough. If you want to continue using the selected language, please {participateInTheTranslation} of the project.",
"components.profile.mojangPriorityWarning": "Пронађен је Mojang налог са истим надимком. Према {rules}, власник налога има право да затражи враћање контроле над надимком.",
"components.profile.multiFactorAuth.codePlaceholder": "Овде унесите кôд",
"components.profile.multiFactorAuth.disable": "Онемогући",
@@ -198,6 +199,7 @@
"components.profile.multiFactorAuth.theAppIsInstalled": "Апликација је инсталирана",
"components.profile.multiFactorAuth.whenKeyEntered": "Ако се привремени кôд појави у апликацији за потврду идентитета помоћу два фактора, можете прећи на следећи корак.",
"components.profile.nickname": "Надимак:",
+ "components.profile.participateInTheTranslation": "participate in the translation",
"components.profile.password": "Лозинка:",
"components.profile.passwordRequestForm.continue": "Настави",
"components.profile.passwordRequestForm.description": "Да бисте довршили радњу, унесите лозинку налога",
diff --git a/src/i18n/uk.json b/src/i18n/uk.json
index ae89164..f8b67e0 100644
--- a/src/i18n/uk.json
+++ b/src/i18n/uk.json
@@ -177,6 +177,7 @@
"components.profile.disabled": "Вимкнено",
"components.profile.email": "E‑mail:",
"components.profile.enabled": "Увімкнена",
+ "components.profile.languageIsUnavailableWarning": "The locale \"{locale}\" you've used earlier isn't currently translated enough. If you want to continue using the selected language, please {participateInTheTranslation} of the project.",
"components.profile.mojangPriorityWarning": "Знайдений акаунт Mojang з таким же ніком. Майте на увазі, що згідно з {rules}, його власник має право вимагати відновлення контролю над ніком.",
"components.profile.multiFactorAuth.codePlaceholder": "Вкажіть код сюди",
"components.profile.multiFactorAuth.disable": "Вимкнути",
@@ -198,6 +199,7 @@
"components.profile.multiFactorAuth.theAppIsInstalled": "Додаток встановлено",
"components.profile.multiFactorAuth.whenKeyEntered": "Після того, як ви побачили в додатку тимчасовий код, перейдіть до наступного кроку.",
"components.profile.nickname": "Нік:",
+ "components.profile.participateInTheTranslation": "participate in the translation",
"components.profile.password": "Пароль:",
"components.profile.passwordRequestForm.continue": "Продовжити",
"components.profile.passwordRequestForm.description": "Для завершення, вкажіть пароль від акаунту",
diff --git a/src/i18n/vi.json b/src/i18n/vi.json
index 705a6d2..baebf0a 100644
--- a/src/i18n/vi.json
+++ b/src/i18n/vi.json
@@ -177,6 +177,7 @@
"components.profile.disabled": "Đã vô hiệu hóa",
"components.profile.email": "E‑mail:",
"components.profile.enabled": "Đã kích hoạt",
+ "components.profile.languageIsUnavailableWarning": "The locale \"{locale}\" you've used earlier isn't currently translated enough. If you want to continue using the selected language, please {participateInTheTranslation} of the project.",
"components.profile.mojangPriorityWarning": "Một tài khoản Mojang với nickname này đã được tìm thấy. Theo {rules}, chủ của tài khoản có quyền được lấy lại nickname của mình.",
"components.profile.multiFactorAuth.codePlaceholder": "Nhập mã vào đây",
"components.profile.multiFactorAuth.disable": "Vô hiệu hoá",
@@ -198,6 +199,7 @@
"components.profile.multiFactorAuth.theAppIsInstalled": "Ứng dụng đã được cài đặt",
"components.profile.multiFactorAuth.whenKeyEntered": "Nếu xuất hiện một mã tạm thời trong ứng dụng xác thực 2 bước thì bạn đã sẵn sàng để đến với bước kế tiếp.",
"components.profile.nickname": "Nickname:",
+ "components.profile.participateInTheTranslation": "participate in the translation",
"components.profile.password": "Mật khẩu:",
"components.profile.passwordRequestForm.continue": "Tiếp tục",
"components.profile.passwordRequestForm.description": "Để hoàn tất hành động hãy nhập mật khẩu tài khoản",
diff --git a/src/i18n/zh.json b/src/i18n/zh.json
index 0e16d20..75112bd 100644
--- a/src/i18n/zh.json
+++ b/src/i18n/zh.json
@@ -177,6 +177,7 @@
"components.profile.disabled": "禁用 ",
"components.profile.email": "Email:",
"components.profile.enabled": "启用",
+ "components.profile.languageIsUnavailableWarning": "The locale \"{locale}\" you've used earlier isn't currently translated enough. If you want to continue using the selected language, please {participateInTheTranslation} of the project.",
"components.profile.mojangPriorityWarning": "找到一个具有相同昵称的Mojang帐户。根据{rules},账户拥有者有权要求恢复对昵称的控制权。",
"components.profile.multiFactorAuth.codePlaceholder": "在这里输入代码",
"components.profile.multiFactorAuth.disable": "禁用",
@@ -198,6 +199,7 @@
"components.profile.multiFactorAuth.theAppIsInstalled": "应用程序已成功安装",
"components.profile.multiFactorAuth.whenKeyEntered": "如果临时代码出现在双重认证应用程序中,则可以继续下一步。",
"components.profile.nickname": "名称:",
+ "components.profile.participateInTheTranslation": "participate in the translation",
"components.profile.password": "密码:",
"components.profile.passwordRequestForm.continue": "继续",
"components.profile.passwordRequestForm.description": "要完成操作,请输入原帐户密码",
diff --git a/src/services/i18n.js b/src/services/i18n.js
index f015582..cf72d77 100644
--- a/src/services/i18n.js
+++ b/src/services/i18n.js
@@ -1,3 +1,4 @@
+// @flow
import locales from 'i18n/index.json';
import { addLocaleData } from 'react-intl';
@@ -7,37 +8,40 @@ const DEFAULT_LANGUAGE = 'en';
const needPolyfill = !window.Intl;
-function getUserLanguages(userSelectedLang = []) {
- return [].concat(userSelectedLang || [])
+function getUserLanguages(userSelectedLang: string): Array {
+ return [userSelectedLang]
.concat(navigator.languages || [])
.concat(navigator.language || []);
}
-function detectLanguage(userLanguages, availableLanguages, defaultLanguage) {
- return (userLanguages || [])
- .concat(defaultLanguage)
+function detectLanguage(
+ userLanguages: Array,
+ availableLanguages: Array,
+ defaultLanguage: string,
+): string {
+ return userLanguages
.map((lang) => lang.split('-').shift().toLowerCase())
- .find((lang) => availableLanguages.indexOf(lang) !== -1);
+ .find((lang) => availableLanguages.indexOf(lang) !== -1) || defaultLanguage;
}
export default {
- detectLanguage(lang) {
+ detectLanguage(lang: string): string {
return detectLanguage(getUserLanguages(lang), SUPPORTED_LANGUAGES, DEFAULT_LANGUAGE);
},
- require(locale) {
- const promises = [
+ require(locale: string): Promise<{
+ locale: string;
+ messages: { [string]: string };
+ }> {
+ const promises: Array> = [
new Promise(require(`bundle?name=[name]!react-intl/locale-data/${locale}.js`)),
new Promise(require(`bundle?name=[name]!i18n/${locale}.json`))
];
if (needPolyfill) {
- promises.push(
- new Promise(require('bundle?name=intl!intl')),
- );
- promises.push(
- new Promise(require(`bundle?name=[name]-polyfill-data!intl/locale-data/jsonp/${locale}.js`)),
- );
+ // $FlowFixMe
+ promises.push(new Promise(require('bundle?name=intl!intl')));
+ promises.push(new Promise(require(`bundle?name=[name]-polyfill-data!intl/locale-data/jsonp/${locale}.js`)));
}
return Promise.all(promises)