Skip to content

Commit

Permalink
feat: add more languages (#773)
Browse files Browse the repository at this point in the history
adds Icelandic (is), Romanian (ro), Dutch (nl-be) and Swedish (sv-se)
  • Loading branch information
hacdias committed Jun 9, 2019
1 parent ffd8a3a commit c0575a6
Show file tree
Hide file tree
Showing 7 changed files with 507 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .tx/config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[main]
host = https://www.transifex.com
lang_map = pt_BR: pt-br, zh_CN: zh-cn, zh_HK: zh-hk, zh_TW: zh-tw
lang_map = pt_BR: pt-br, zh_CN: zh-cn, zh_HK: zh-hk, zh_TW: zh-tw, nl_BE: nl-be, sv_SE: sv-se

[file-browser.file-browser]
file_filter = frontend/src/i18n/<lang>.json
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/components/settings/Languages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
<option value="en">{{ $t('languages.en') }}</option>
<option value="es">{{ $t('languages.es') }}</option>
<option value="fr">{{ $t('languages.fr') }}</option>
<option value="is">{{ $t('languages.is') }}</option>
<option value="it">{{ $t('languages.it') }}</option>
<option value="ja">{{ $t('languages.ja') }}</option>
<option value="ko">{{ $t('languages.ko') }}</option>
<option value="nl-be">{{ $t('languages.nlBE') }}</option>
<option value="pl">{{ $t('languages.pl') }}</option>
<option value="pt-br">{{ $t('languages.ptBR') }}</option>
<option value="pt">{{ $t('languages.pt') }}</option>
<option value="ro">{{ $t('languages.ro') }}</option>
<option value="ru">{{ $t('languages.ru') }}</option>
<option value="sv-se">{{ $t('languages.svSE') }}</option>
<option value="zh-cn">{{ $t('languages.zhCN') }}</option>
<option value="zh-tw">{{ $t('languages.zhTW') }}</option>
</select>
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
"languages": {
"ar": "العربية",
"en": "English",
"is": "Icelandic",
"it": "Italiano",
"fr": "Français",
"pt": "Português",
Expand All @@ -220,7 +221,10 @@
"de": "Deutsch",
"ru": "Русский",
"pl": "Polski",
"ko": "한국어"
"ko": "한국어",
"nlBE": "Dutch (Belgium)",
"ro": "Romanian",
"svSE": "Swedish (Sweden)"
},
"time": {
"unit": "Time Unit",
Expand Down
20 changes: 10 additions & 10 deletions frontend/src/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"linkCopied": "¡Link copiado!"
},
"errors": {
"forbidden": "You don't have permissions to access this.",
"forbidden": "No tienes los permisos necesarios para acceder.",
"internal": "La verdad es que algo ha ido mal.",
"notFound": "No se puede acceder a este lugar."
},
Expand Down Expand Up @@ -82,7 +82,7 @@
"loginInstead": "Usuario ya existente",
"passwordsDontMatch": "Las contraseñas no coinciden",
"usernameTaken": "Nombre usuario no disponible",
"signup": "Signup",
"signup": "Registrate",
"username": "Usuario",
"wrongCredentials": "Usuario y/o contraseña incorrectos"
},
Expand Down Expand Up @@ -120,11 +120,11 @@
},
"settings": {
"instanceName": "Nombre de la instancia",
"brandingDirectoryPath": "Branding directory path",
"brandingDirectoryPath": "Ruta de la carpeta de personalizacion de marca",
"documentation": "documentación",
"branding": "Branding",
"branding": "Marca",
"disableExternalLinks": "Deshabilitar enlaces externos (excepto documentación)",
"brandingHelp": "You can costumize how your File Browser instance looks and feels by changing its name, replacing the logo, adding custom styles and even disable external links to GitHub.\nFor more information about custom branding, please check out the {0}.",
"brandingHelp": "Tú puedes personalizar como se ve tu instancia de FileBrowser cambiándole el nombre, reemplazando ellogo, agregar estilos personalizados e incluso deshabilitando loslinks externos que apuntan hacia GitHub. \nPara mayor información acerca de personalización de marca, por favor revisa el {0}.",
"admin": "Admin",
"administrator": "Administrador",
"allowCommands": "Ejecutar comandos",
Expand Down Expand Up @@ -165,7 +165,7 @@
"users": "Usuarios",
"globalRules": "This is a global set of allow and disallow rules. They apply to every user. You can define specific rules on each user's settings to override this ones.",
"allowSignup": "Permitir registro de usuarios",
"createUserDir": "Auto create user home dir while adding new user",
"createUserDir": "Crea automaticamente una carpeta de inicio cuando se agrega un usuario",
"insertRegex": "Introducir expresión regular",
"insertPath": "Introduce la ruta",
"userUpdated": "¡Usuario actualizado!",
Expand All @@ -185,8 +185,8 @@
},
"sidebar": {
"help": "Ayuda",
"login": "Login",
"signup": "Signup",
"login": "Iniciar sesión",
"signup": "Registrate",
"logout": "Cerrar sesión",
"myFiles": "Mis archivos",
"newFile": "Nuevo archivo",
Expand All @@ -203,8 +203,8 @@
"types": "Tipos",
"video": "Vídeo",
"search": "Buscar...",
"typeToSearch": "Type to search...",
"pressToSearch": "Press enter to search..."
"typeToSearch": "Escribe para realizar una busqueda...",
"pressToSearch": "Presiona enter para buscar..."
},
"languages": {
"ar": "العربية",
Expand Down
19 changes: 15 additions & 4 deletions frontend/src/i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ import de from './de.json'
import en from './en.json'
import es from './es.json'
import fr from './fr.json'
import is from './is.json'
import it from './it.json'
import ja from './ja.json'
import pl from './pl.json'
import ko from './ko.json'
import nlBE from './nl-be.json'
import pl from './pl.json'
import pt from './pt.json'
import ptBR from './pt-br.json'
import ro from './ro.json'
import ru from './ru.json'
import svSE from './sv-se.json'
import zhCN from './zh-cn.json'
import zhTW from './zh-tw.json'

Expand All @@ -21,6 +25,12 @@ Vue.use(VueI18n)
export function detectLocale () {
let locale = (navigator.language || navigator.browserLangugae).toLowerCase()
switch (true) {
case /^ar.*/i.test(locale):
locale = 'ar'
break
case /^es.*/i.test(locale):
locale = 'es'
break
case /^en.*/i.test(locale):
locale = 'en'
break
Expand Down Expand Up @@ -48,9 +58,6 @@ export function detectLocale () {
case /^zh.*/i.test(locale):
locale = 'zh-cn'
break
case /^es.*/i.test(locale):
locale = 'es'
break
case /^de.*/i.test(locale):
locale = 'de'
break
Expand Down Expand Up @@ -79,13 +86,17 @@ const i18n = new VueI18n({
'en': en,
'es': es,
'fr': fr,
'is': is,
'it': it,
'ja': ja,
'ko': ko,
'nl-be': nlBE,
'pl': pl,
'pt-br': ptBR,
'pt': pt,
'ru': ru,
'ro': ro,
'sv-se': svSE,
'zh-cn': zhCN,
'zh-tw': zhTW
}
Expand Down
Loading

0 comments on commit c0575a6

Please sign in to comment.