Skip to content

Commit

Permalink
Merge pull request #3738 from h3poteto/feat/add-translations
Browse files Browse the repository at this point in the history
Add Persian and Icelandic
  • Loading branch information
h3poteto authored Nov 4, 2022
2 parents caa664f + 4eeb8cd commit bf42b46
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
23 changes: 22 additions & 1 deletion spec/config/i18n.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,28 @@ import * as path from 'path'
import fs from 'fs'
import keys from 'all-object-keys'

const locales = ['de', 'fr', 'gd', 'it', 'ja', 'ko', 'pl', 'it', 'zh_cn', 'zh_tw', 'cs', 'es_es', 'no', 'pt_pt', 'ru', 'si', 'sv_se', 'tzm']
const locales = [
'de',
'fr',
'gd',
'it',
'ja',
'ko',
'pl',
'is',
'it',
'zh_cn',
'zh_tw',
'cs',
'es_es',
'no',
'pt_pt',
'ru',
'si',
'sv_se',
'tzm',
'fa'
]

describe('i18n', () => {
describe('should not define duplicate keys', () => {
Expand Down
8 changes: 8 additions & 0 deletions src/config/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import cs from '~/src/config/locales/cs/translation.json'
import de from '~/src/config/locales/de/translation.json'
import en from '~/src/config/locales/en/translation.json'
import es_es from '~/src/config/locales/es_es/translation.json'
import fa from '~/src/config/locales/fa/translation.json'
import fr from '~/src/config/locales/fr/translation.json'
import gd from '~/src/config/locales/gd/translation.json'
import id from '~/src/config/locales/id/translation.json'
import it from '~/src/config/locales/it/translation.json'
import is from '~/src/config/locales/is/translation.json'
import ja from '~/src/config/locales/ja/translation.json'
import ko from '~/src/config/locales/ko/translation.json'
import no from '~/src/config/locales/no/translation.json'
Expand Down Expand Up @@ -37,6 +39,9 @@ const options: InitOptions = {
es_es: {
translation: es_es
},
fa: {
translation: fa
},
fr: {
translation: fr
},
Expand All @@ -49,6 +54,9 @@ const options: InitOptions = {
it: {
translation: it
},
is: {
translation: is
},
ja: {
translation: ja
},
Expand Down
12 changes: 12 additions & 0 deletions src/constants/language/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export type LanguageList = {
si: LanguageType
sv_se: LanguageType
tzm: LanguageType
fa: LanguageType
is: LanguageType
}

const languageList: LanguageList = {
Expand All @@ -37,6 +39,11 @@ const languageList: LanguageList = {
key: 'en',
rfc4646: 'en-US'
},
fa: {
name: 'Persian',
key: 'fa',
rfc4646: 'fa'
},
fr: {
name: 'Français',
key: 'fr',
Expand Down Expand Up @@ -67,6 +74,11 @@ const languageList: LanguageList = {
key: 'id',
rfc4646: 'id'
},
is: {
name: 'Icelandic',
key: 'is',
rfc4646: 'is'
},
it: {
name: 'Italiano',
key: 'it',
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/components/Preferences/Language.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ export default defineComponent({
Language.de,
Language.en,
Language.es_es,
Language.fa,
Language.fr,
Language.gd,
Language.id,
Language.is,
Language.it,
Language.ja,
Language.ko,
Expand Down

0 comments on commit bf42b46

Please sign in to comment.