Added german translation

This commit is contained in:
RemixDev
2020-07-29 16:29:25 +02:00
parent 6863384632
commit c935a33fdb
5 changed files with 373 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ import VueI18n from 'vue-i18n'
import it from '@/lang/it'
import en from '@/lang/en'
import es from '@/lang/es'
import de from '@/lang/de'
Vue.use(VueI18n)
@@ -15,13 +16,30 @@ document.querySelector('html').setAttribute('lang', DEFAULT_LANG)
const locales = {
it,
en,
es
es,
de
}
const i18n = new VueI18n({
locale: DEFAULT_LANG,
fallbackLocale: DEFAULT_LANG,
messages: locales
messages: locales,
pluralizationRules: {
/**
* @param choice {number} a choice index given by the input to $tc: `$tc('path.to.rule', choiceIndex)`
* @param choicesLength {number} an overall amount of available choices
* @returns a final choice index to select plural word by
*/
'ru': function(choice, choicesLength) {
if (choice === 0) { return 0 }
var n = Math.abs(choice) % 100
var n1 = n % 10
if (n > 10 && n < 20) { return 3 }
if (n1 > 1 && n1 < 5) { return 2 }
if (n1 == 1) { return 1 }
return 3;
}
}
})
export default i18n