mirror of
https://github.com/plankanban/planka.git
synced 2025-12-25 01:11:49 +03:00
fix: Set detected language on first login, remove auto-detect language option
This commit is contained in:
@@ -29,8 +29,7 @@ const AccountPane = React.memo(() => {
|
||||
|
||||
const handleLanguageChange = useCallback(
|
||||
(_, { value }) => {
|
||||
// FIXME: hack
|
||||
dispatch(entryActions.updateCurrentUserLanguage(value === 'auto' ? null : value));
|
||||
dispatch(entryActions.updateCurrentUserLanguage(value));
|
||||
},
|
||||
[dispatch],
|
||||
);
|
||||
@@ -62,18 +61,12 @@ const AccountPane = React.memo(() => {
|
||||
<Dropdown
|
||||
fluid
|
||||
selection
|
||||
options={[
|
||||
{
|
||||
value: 'auto',
|
||||
text: t('common.detectAutomatically'),
|
||||
},
|
||||
...locales.map((locale) => ({
|
||||
value: locale.language,
|
||||
flag: locale.country,
|
||||
text: locale.name,
|
||||
})),
|
||||
]}
|
||||
value={user.language || 'auto'}
|
||||
options={locales.map((locale) => ({
|
||||
value: locale.language,
|
||||
flag: locale.country,
|
||||
text: locale.name,
|
||||
}))}
|
||||
value={user.language}
|
||||
onChange={handleLanguageChange}
|
||||
/>
|
||||
{(isUsernameEditable || isEmailEditable || isPasswordEditable) && (
|
||||
|
||||
@@ -151,7 +151,7 @@ i18n.loadCoreLocale = async (language = i18n.resolvedLanguage) => {
|
||||
});
|
||||
};
|
||||
|
||||
i18n.detectLanguage = () => {
|
||||
/* i18n.detectLanguage = () => {
|
||||
const {
|
||||
services: { languageDetector, languageUtils },
|
||||
} = i18n;
|
||||
@@ -164,6 +164,6 @@ i18n.detectLanguage = () => {
|
||||
|
||||
i18n.resolvedLanguage = undefined;
|
||||
i18n.setResolvedLanguage(i18n.language);
|
||||
};
|
||||
}; */
|
||||
|
||||
export default i18n;
|
||||
|
||||
@@ -142,7 +142,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: 'الوصف',
|
||||
detectAutomatically: 'الكشف تلقائياً',
|
||||
display: null,
|
||||
dropFileToUpload: 'أفلت الملف لرفعه',
|
||||
dueDate_title: 'تاريخ الاستحقاق',
|
||||
|
||||
@@ -146,7 +146,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: 'Описание',
|
||||
detectAutomatically: 'Aвтоматично откриване',
|
||||
display: null,
|
||||
dropFileToUpload: 'Пуснете файл за качване',
|
||||
dueDate_title: 'Краен срок',
|
||||
|
||||
@@ -156,7 +156,6 @@ export default {
|
||||
deleteWebhook_title: 'Smazat webhook',
|
||||
deletedUser_title: 'Smazaný uživatel',
|
||||
description: 'Popis',
|
||||
detectAutomatically: 'Automatická detekce',
|
||||
display: 'Zobrazit',
|
||||
dropFileToUpload: 'Přetažením nahrát soubor',
|
||||
dueDate_title: 'Termín',
|
||||
|
||||
@@ -161,7 +161,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: 'Slettet bruger',
|
||||
description: 'Beskrivelse',
|
||||
detectAutomatically: 'Registrer automatisk',
|
||||
display: 'Vis',
|
||||
dropFileToUpload: 'Slip fil for at uploade',
|
||||
dueDate_title: 'Frist',
|
||||
|
||||
@@ -170,7 +170,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: 'Gelöschter Benutzer',
|
||||
description: 'Beschreibung',
|
||||
detectAutomatically: 'Automatisch erkennen',
|
||||
display: 'Anzeige',
|
||||
dropFileToUpload: 'Datei für Upload ablegen',
|
||||
dueDate_title: 'Fälligkeitsdatum',
|
||||
|
||||
@@ -171,7 +171,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: 'Διαγραμμένος χρήστης',
|
||||
description: 'Περιγραφή',
|
||||
detectAutomatically: 'Αυτόματη ανίχνευση',
|
||||
display: 'Εμφάνιση',
|
||||
dropFileToUpload: 'Σύρετε το αρχείο για μεταφόρτωση',
|
||||
dueDate_title: 'Ημερομηνία λήξης',
|
||||
|
||||
@@ -160,7 +160,6 @@ export default {
|
||||
deleteWebhook_title: 'Delete Webhook',
|
||||
deletedUser_title: 'Deleted User',
|
||||
description: 'Description',
|
||||
detectAutomatically: 'Detect automatically',
|
||||
display: 'Display',
|
||||
dropFileToUpload: 'Drop file to upload',
|
||||
dueDate_title: 'Due Date',
|
||||
|
||||
@@ -155,7 +155,6 @@ export default {
|
||||
deleteWebhook_title: 'Delete Webhook',
|
||||
deletedUser_title: 'Deleted User',
|
||||
description: 'Description',
|
||||
detectAutomatically: 'Detect automatically',
|
||||
display: 'Display',
|
||||
dropFileToUpload: 'Drop file to upload',
|
||||
dueDate_title: 'Due Date',
|
||||
|
||||
@@ -166,7 +166,6 @@ export default {
|
||||
deleteWebhook_title: 'Eliminar webhook',
|
||||
deletedUser_title: 'Usuario eliminado',
|
||||
description: 'Descripción',
|
||||
detectAutomatically: 'Detectar automáticamente',
|
||||
display: 'Mostrar',
|
||||
dropFileToUpload: 'Arrastra archivo para subir',
|
||||
dueDate_title: 'Fecha de vencimiento',
|
||||
|
||||
@@ -160,7 +160,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: 'Kustutatud kasutaja',
|
||||
description: 'Kirjeldus',
|
||||
detectAutomatically: 'Tuletage automaatselt',
|
||||
display: 'Kuva',
|
||||
dropFileToUpload: 'Lase faili üleslaadida',
|
||||
dueDate_title: 'Tähtaeg',
|
||||
|
||||
@@ -143,7 +143,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: 'توضیحات',
|
||||
detectAutomatically: 'تشخیص خودکار',
|
||||
display: null,
|
||||
dropFileToUpload: 'فایل را برای آپلود بکشید',
|
||||
dueDate_title: 'تاریخ سررسید',
|
||||
|
||||
@@ -156,7 +156,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: 'Poistettu käyttäjä',
|
||||
description: 'Kuvaus',
|
||||
detectAutomatically: 'Tunnista automaattisesti',
|
||||
display: 'Näyttö',
|
||||
dropFileToUpload: 'Pudota tiedosto ladattavaksi',
|
||||
dueDate_title: 'Määräpäivä',
|
||||
|
||||
@@ -164,7 +164,6 @@ export default {
|
||||
deleteWebhook_title: 'Supprimer le webhook',
|
||||
deletedUser_title: 'Utilisateur supprimé',
|
||||
description: 'Description',
|
||||
detectAutomatically: 'Détecter automatiquement',
|
||||
display: 'Affichage',
|
||||
dropFileToUpload: 'Déposer le fichier à télécharger',
|
||||
dueDate_title: "Date d'échéance",
|
||||
|
||||
@@ -153,7 +153,6 @@ export default {
|
||||
deleteWebhook_title: 'Webhook törlése',
|
||||
deletedUser_title: 'Törölt felhasználó',
|
||||
description: 'Leírás',
|
||||
detectAutomatically: 'Automatikus érzékelés',
|
||||
display: 'Megjelenítés',
|
||||
dropFileToUpload: 'Dobja ide a fájlt a feltöltéshez',
|
||||
dueDate_title: 'Esedékesség dátuma',
|
||||
|
||||
@@ -145,7 +145,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: 'Deskripsi',
|
||||
detectAutomatically: 'Deteksi otomatis',
|
||||
display: null,
|
||||
dropFileToUpload: 'Tarik berkas untuk menggungah',
|
||||
dueDate_title: 'Tenggat Waktu',
|
||||
|
||||
@@ -162,7 +162,6 @@ export default {
|
||||
deleteWebhook_title: 'Elimina webhook',
|
||||
deletedUser_title: 'Utente eliminato',
|
||||
description: 'Descrizione',
|
||||
detectAutomatically: 'Rileva automaticamente',
|
||||
display: 'Mostra',
|
||||
dropFileToUpload: 'Trascina il file da caricare',
|
||||
dueDate_title: 'Data di scadenza',
|
||||
|
||||
@@ -145,7 +145,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: '説明',
|
||||
detectAutomatically: '自動的に検知',
|
||||
display: null,
|
||||
dropFileToUpload: 'ファイルをドロップしてアップロード',
|
||||
dueDate_title: '期限',
|
||||
|
||||
@@ -143,7 +143,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: '설명',
|
||||
detectAutomatically: '자동 감지',
|
||||
display: null,
|
||||
dropFileToUpload: '업로드할 파일을 드롭하세요',
|
||||
dueDate_title: '마감일',
|
||||
|
||||
@@ -145,7 +145,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: 'Beschrijving',
|
||||
detectAutomatically: 'Automatisch detecteren',
|
||||
display: null,
|
||||
dropFileToUpload: 'Sleep bestand om te uploaden',
|
||||
dueDate_title: 'Vervaldatum',
|
||||
|
||||
@@ -152,7 +152,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: 'Usunięty Użytkownik',
|
||||
description: 'Opis',
|
||||
detectAutomatically: 'Wykryj automatycznie',
|
||||
display: 'Wyświetlanie',
|
||||
dropFileToUpload: 'Upuść plik aby wgrać',
|
||||
dueDate_title: 'Termin',
|
||||
|
||||
@@ -162,7 +162,6 @@ export default {
|
||||
deleteWebhook_title: 'Excluir Webhook',
|
||||
deletedUser_title: 'Usuário Excluído',
|
||||
description: 'Descrição',
|
||||
detectAutomatically: 'Detectar automaticamente',
|
||||
display: 'Exibir',
|
||||
dropFileToUpload: 'Solte o arquivo para enviar',
|
||||
dueDate_title: 'Data de Vencimento',
|
||||
|
||||
@@ -146,7 +146,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: 'Descrição',
|
||||
detectAutomatically: 'Detetar automaticamente',
|
||||
display: null,
|
||||
dropFileToUpload: 'Largue o ficheiro para carregar',
|
||||
dueDate_title: 'Data de Vencimento',
|
||||
|
||||
@@ -145,7 +145,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: 'Descriere',
|
||||
detectAutomatically: 'Detectează automat',
|
||||
display: null,
|
||||
dropFileToUpload: 'Aruncă fișierul pentru a încărca',
|
||||
dueDate_title: 'Data scadentă',
|
||||
|
||||
@@ -159,7 +159,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: 'Удалённый пользователь',
|
||||
description: 'Описание',
|
||||
detectAutomatically: 'Определить автоматически',
|
||||
display: 'Отображение',
|
||||
dropFileToUpload: 'Перетяните файл, чтобы загрузить',
|
||||
dueDate_title: 'Срок исполнения',
|
||||
|
||||
@@ -145,7 +145,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: 'Popis',
|
||||
detectAutomatically: null,
|
||||
display: null,
|
||||
dropFileToUpload: 'Potiahnutím nahraj súbor',
|
||||
dueDate_title: 'Termín do',
|
||||
|
||||
@@ -145,7 +145,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: 'Опис',
|
||||
detectAutomatically: 'Детектуј аутоматски',
|
||||
display: null,
|
||||
dropFileToUpload: 'Превуци датотеку за слање',
|
||||
dueDate_title: 'Рок',
|
||||
|
||||
@@ -142,7 +142,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: 'Opis',
|
||||
detectAutomatically: 'Detektuj automatski',
|
||||
display: null,
|
||||
dropFileToUpload: 'Prevuci datoteku za slanje',
|
||||
dueDate_title: 'Rok',
|
||||
|
||||
@@ -144,7 +144,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: 'Beskrivning',
|
||||
detectAutomatically: null,
|
||||
display: null,
|
||||
dropFileToUpload: 'Släpp en fil för att ladda upp',
|
||||
dueDate_title: 'Förfallodatum',
|
||||
|
||||
@@ -142,7 +142,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: 'açıklama',
|
||||
detectAutomatically: 'Otomatik olarak algıla',
|
||||
display: null,
|
||||
dropFileToUpload: 'Yüklenecek dosyayı buraya bırakın',
|
||||
dueDate_title: 'Termin Tarihi',
|
||||
|
||||
@@ -157,7 +157,6 @@ export default {
|
||||
deleteWebhook_title: 'Видалити вебхук',
|
||||
deletedUser_title: 'Видалений користувач',
|
||||
description: 'Опис',
|
||||
detectAutomatically: 'Визначити автоматично',
|
||||
display: 'Дисплей',
|
||||
dropFileToUpload: 'Перетягніть файл для завантаження',
|
||||
dueDate_title: 'Крайній Термін',
|
||||
|
||||
@@ -141,7 +141,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: 'Tavsif',
|
||||
detectAutomatically: null,
|
||||
display: null,
|
||||
dropFileToUpload: 'Faylni yuklash uchun qoldiring',
|
||||
dueDate_title: 'Muddati',
|
||||
|
||||
@@ -142,7 +142,6 @@ export default {
|
||||
deleteWebhook_title: '删除Webhook',
|
||||
deletedUser_title: '已删除用户',
|
||||
description: '描述',
|
||||
detectAutomatically: '自动检测',
|
||||
display: '显示',
|
||||
dropFileToUpload: '拖放文件以上传',
|
||||
dueDate_title: '截止日期',
|
||||
|
||||
@@ -139,7 +139,6 @@ export default {
|
||||
deleteWebhook_title: null,
|
||||
deletedUser_title: null,
|
||||
description: '描述',
|
||||
detectAutomatically: '自動偵測',
|
||||
display: null,
|
||||
dropFileToUpload: '拖放文件以上傳',
|
||||
dueDate_title: '截止日期',
|
||||
|
||||
@@ -79,14 +79,8 @@ export function* initializeCore() {
|
||||
}
|
||||
|
||||
export function* changeCoreLanguage(language) {
|
||||
if (language === null) {
|
||||
yield call(i18n.detectLanguage);
|
||||
yield call(i18n.loadCoreLocale);
|
||||
yield call(i18n.changeLanguage, i18n.resolvedLanguage);
|
||||
} else {
|
||||
yield call(i18n.loadCoreLocale, language);
|
||||
yield call(i18n.changeLanguage, language);
|
||||
}
|
||||
yield call(i18n.loadCoreLocale, language);
|
||||
yield call(i18n.changeLanguage, language);
|
||||
}
|
||||
|
||||
export function* toggleFavorites(isEnabled) {
|
||||
|
||||
@@ -140,6 +140,7 @@ export function* acceptTerms(signature) {
|
||||
({ item: accessToken } = yield call(api.acceptTerms, {
|
||||
pendingToken,
|
||||
signature,
|
||||
initialLanguage: i18n.resolvedLanguage,
|
||||
}));
|
||||
} catch (error) {
|
||||
yield put(actions.acceptTerms.failure(error));
|
||||
|
||||
Reference in New Issue
Block a user