[MM-14058] Add support for i18n (#2190)

* Add language files

* Add react-intl, mmjstool, setup for adding translations

* Translated main module

* Translations for renderer

* A few minor fixes

* More fixes

* Add CI, add missing menu translations, other cleanup

* Added setting to manually select the language of the app

* Force English for E2e

* Unit tests

* Fix mmjstool

* Move set language to before update menu

* PR feedback
This commit is contained in:
Devin Binnie
2022-07-14 11:04:18 -04:00
committed by GitHub
parent 22c97591d5
commit 59e4e7e516
92 changed files with 3554 additions and 2375 deletions

View File

@@ -122,3 +122,7 @@ export const RELOAD_CURRENT_VIEW = 'reload-current-view';
export const PING_DOMAIN = 'ping-domain';
export const PING_DOMAIN_RESPONSE = 'ping-domain-response';
export const GET_LANGUAGE_INFORMATION = 'get-language-information';
export const RETRIEVED_LANGUAGE_INFORMATION = 'retrieved-language-information';
export const GET_AVAILABLE_LANGUAGES = 'get-available-languages';

View File

@@ -328,6 +328,10 @@ export class Config extends EventEmitter {
return this.combinedData?.autoCheckForUpdates;
}
get appLanguage() {
return this.combinedData?.appLanguage;
}
// initialization/processing methods
/**

View File

@@ -6,5 +6,5 @@ export const BASIC_AUTH_PERMISSION = 'canBasicAuth';
// Permission descriptions
export const PERMISSION_DESCRIPTION = {
[BASIC_AUTH_PERMISSION]: 'Web Authentication',
[BASIC_AUTH_PERMISSION]: 'common.permissions.canBasicAuth',
};

View File

@@ -59,10 +59,6 @@ export function getServerView(srv: MattermostServer, tab: Tab) {
}
}
export function getTabViewName(serverName: string, tabType: string) {
return `${serverName}___${tabType}`;
}
export function getTabDisplayName(tabType: TabType) {
switch (tabType) {
case TAB_MESSAGING:
@@ -76,6 +72,10 @@ export function getTabDisplayName(tabType: TabType) {
}
}
export function getTabViewName(serverName: string, tabType: string) {
return `${serverName}___${tabType}`;
}
export function canCloseTab(tabType: TabType) {
return tabType !== TAB_MESSAGING;
}

View File

@@ -60,6 +60,10 @@ function isVersionGreaterThanOrEqualTo(currentVersion: string, compareVersion: s
return true;
}
export function t(s: string) {
return s;
}
export default {
getDisplayBoundaries,
runMode,