Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Chinese language in i18n #40

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"field_language": "Language",
"label_language-en": "English",
"label_language-ru": "Русский",
"label_language-zh-cn": "中文",
"label_not-found": "No results",
"label_placeholder-search": "Search settings",
"label_title": "Settings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"field_language": "Язык",
"label_language-en": "English",
"label_language-ru": "Русский",
"label_language-zh-cn": "中文",
"label_not-found": "Ничего не найдено",
"label_placeholder-search": "Найти настройки",
"label_title": "Настройки",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n-keysets/wizard/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
"label_visualization-types-pie": "Pie",
"label_visualization-types-table": "Tables",
"label_week": "Week",
"label_widget-name-copy": "{{name}} - copy",
"label_widget-name-copy": "{{name}}-copy",
"label_without-group": "Without grouping",
"label_year": "Year",
"label_yellow": "Yellow (shades)",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n-keysets/wizard/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
"label_visualization-types-pie": "Круговые",
"label_visualization-types-table": "Таблицы",
"label_week": "Неделя",
"label_widget-name-copy": "{{name}} - копия",
"label_widget-name-copy": "{{name}}-копия",
"label_without-group": "Без группировки",
"label_year": "Год",
"label_yellow": "Желтый (оттенки)",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (isBrowserEnv && !isJestEnv) {
i18nPrepared = initI18n({lang, content: window[GLOBAL_I18N_VAR] || {}});
} else {
// empty keysets for jest (mock i18n as needed)
i18nPrepared = initI18n([{lang: 'ru'}, {lang: 'en'}]);
i18nPrepared = initI18n([{lang: 'ru'}, {lang: 'zh-cn'}, {lang: 'en'}]);
}

export const I18N = i18nPrepared.I18N;
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/prepare-keysets/constants.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const KEYSET_LANGUAGES = ['ru', 'en'];
export const KEYSET_LANGUAGES = ['ru', 'zh-cn', 'en'];
export const LANG_FOR_TYPES = 'ru';
2 changes: 1 addition & 1 deletion src/server/configs/opensource/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {

regionalEnvConfig: {
defaultLang: Language.En,
allowLanguages: [Language.En, Language.Ru],
allowLanguages: [Language.En, Language.Cn, Language.Ru],
},

csp: 'disabled',
Expand Down
1 change: 1 addition & 0 deletions src/shared/constants/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export enum AppMode {
export enum Language {
Ru = 'ru',
En = 'en',
Cn = 'zh-cn',
}

export enum DeviceType {
Expand Down