Adding new languages

This commit is contained in:
Jesús Espino 2021-03-25 19:46:59 +01:00
parent 8845683b09
commit 325cedc5df
3 changed files with 28 additions and 0 deletions

View file

@ -70,6 +70,7 @@
"Sidebar.add-board": "+ Add Board",
"Sidebar.add-template": "+ New template",
"Sidebar.changePassword": "Change password",
"Sidebar.chinese": "Chinese",
"Sidebar.dark-theme": "Dark theme",
"Sidebar.default-theme": "Default theme",
"Sidebar.delete-board": "Delete board",
@ -88,6 +89,7 @@
"Sidebar.light-theme": "Light theme",
"Sidebar.logout": "Log out",
"Sidebar.no-views-in-board": "No pages inside",
"Sidebar.occitan": "Occitan",
"Sidebar.russian": "Russian",
"Sidebar.select-a-template": "Select a template",
"Sidebar.set-language": "Set language",
@ -95,6 +97,7 @@
"Sidebar.settings": "Settings",
"Sidebar.spanish": "Spanish",
"Sidebar.template-from-board": "New template from board",
"Sidebar.turkish": "Turkish",
"Sidebar.untitled": "Untitled",
"Sidebar.untitled-board": "(Untitled Board)",
"Sidebar.untitled-view": "(Untitled View)",

View file

@ -352,6 +352,21 @@ class Sidebar extends React.Component<Props, State> {
name={intl.formatMessage({id: 'Sidebar.russian', defaultMessage: 'Russian'})}
onClick={async () => this.props.setLanguage('ru')}
/>
<Menu.Text
id='chinese-lang'
name={intl.formatMessage({id: 'Sidebar.chinese', defaultMessage: 'Chinese'})}
onClick={async () => this.props.setLanguage('zh')}
/>
<Menu.Text
id='turkish-lang'
name={intl.formatMessage({id: 'Sidebar.turkish', defaultMessage: 'Turkish'})}
onClick={async () => this.props.setLanguage('tr')}
/>
<Menu.Text
id='occitan-lang'
name={intl.formatMessage({id: 'Sidebar.occitan', defaultMessage: 'Occitan'})}
onClick={async () => this.props.setLanguage('oc')}
/>
</Menu.SubMenu>
<Menu.SubMenu
id='theme'

View file

@ -8,6 +8,10 @@ import messages_ja from '../i18n/ja.json'
import messages_fr from '../i18n/fr.json'
import messages_nl from '../i18n/nl.json'
import messages_ru from '../i18n/ru.json'
import messages_oc from '../i18n/oc.json'
import messages_tr from '../i18n/tr.json'
import messages_zhHant from '../i18n/zh_Hant.json'
export function getMessages(lang: string): {[key: string]: string} {
switch (lang) {
@ -23,6 +27,12 @@ export function getMessages(lang: string): {[key: string]: string} {
return messages_ru
case 'es':
return messages_es
case 'oc':
return messages_oc
case 'tr':
return messages_tr
case 'zh':
return messages_zhHant
}
return messages_en
}