Skip to content

Commit

Permalink
add crowdin translations
Browse files Browse the repository at this point in the history
- Add Crowdin config file
- Cleanup Spanish translations
- Fix some keys sorting
  • Loading branch information
santiagoballadares committed Sep 23, 2024
1 parent 972629c commit 720b4cf
Show file tree
Hide file tree
Showing 9 changed files with 206 additions and 37 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ vite.config.ts.timestamp*

# package.json tarball script
/tarballs

# crowdin (ignore all but the source file)
packages/kotti-ui/source/locales/*.json
!packages/kotti-ui/source/locales/input.json
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,50 @@ There are two workflows to help with rebasing pull requests:
Adding the `autorebase:opt-in` label to any pull request will automatically rebase the PR as soon as it’s out-of-date.
This should preferrably be used by the author, as it requires them to be aware of having to use `git pull --rebase`

### Translations

Translations are currently handled by Kotti's internal implementation. However, there is a Crowdin project to make sure that all translations are correct.

#### Pre-requisites

- Have crowdin cli installed
- MacOs:
```
brew tap crowdin/crowdin
brew install crowdin@3
```
- Linux:
- https://support.crowdin.com/cli-tool/#installation
- Have accesss to https://crowdin.com/project/3yourmind-kotti/en
- Have a crowdin token stored in a local env variable (https://crowdin.com/settings#api-key)
```
export CROWDIN_V2_API_KEY=1234567890...
```
#### Push translations
Whenever new translations are added, edited or removed
1. Update the Crowdin source file `packages/kotti-ui/source/locales/input.json` with latest translations from the Kotti language file `packages/kotti-ui/source/kotti-i18n/locales/en-US.ts`
2. Push the source file to crowdin
```
crowdin push
```
#### Pull translations
1. Check if translations are ready. It should display `100%` next to the target language.
```
crowdin status
```
2. Pull latest translations
```
crowdin pull
```
3. Copy latest translations from the Crowdin language .json file to the corresponding Kotti language file. E.g.:
- From `packages/kotti-ui/source/locales/de.json`
- To `packages/kotti-ui/source/kotti-i18n/locales/de-DE.ts`
### Linting
```bash
Expand Down
8 changes: 8 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
api_token: CROWDIN_V2_API_KEY
base_path: './packages/kotti-ui'
files:
- dest: '/source/locales/input.json'
source: '/source/locales/input.json'
translation: '/source/locales/%two_letters_code%.json'
preserve_hierarchy: true
project_id: '711705'
7 changes: 3 additions & 4 deletions packages/kotti-ui/source/kotti-i18n/locales/de-DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ module Common {

export const deDE: KottiI18n.Messages = {
KtBanner: {
expandLabel: 'Γ–ffnen',
expandCloseLabel: 'Schließen',
expandLabel: 'Γ–ffnen',
},
KtComment: {
cancelMessage: 'DrΓΌcken Sie die Esc-Taste oder',
Expand Down Expand Up @@ -63,10 +63,10 @@ export const deDE: KottiI18n.Messages = {
HIDDEN: '',
INVALID: 'UngΓΌltig',
NOT_STARTED: 'Nicht angefangen',
READY_TO_UPLOAD: 'Bereit zum Hochladen bei Einreichung',
UPLOADED: 'Hochgeladen',
UPLOADED_WITH_ERROR: 'Hochgeladen mit Fehler',
UPLOADING: 'Hochladen...',
READY_TO_UPLOAD: 'Bereit zum Hochladen bei Einreichung',
},
text: {
clickToUpload: 'Zum Hochladen klicken',
Expand All @@ -88,11 +88,10 @@ export const deDE: KottiI18n.Messages = {
},
KtFieldSelects: {
loadingText: 'LΓ€dt',
noMatchText: 'Nichts gefunden',
noDataText: 'Keine Ergebnisse',
noMatchText: 'Nichts gefunden',
placeholder: 'Daten wΓ€hlen',
},
// TODO check KtFilters translations
KtFilters: {
addFilterLabel: 'Filter HinzufΓΌgen',
andLabel: 'Und',
Expand Down
6 changes: 3 additions & 3 deletions packages/kotti-ui/source/kotti-i18n/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ module Common {

export const enUS: KottiI18n.Messages = {
KtBanner: {
expandLabel: 'View',
expandCloseLabel: 'Close',
expandLabel: 'View',
},
KtComment: {
cancelMessage: 'Press Esc key or',
Expand Down Expand Up @@ -63,10 +63,10 @@ export const enUS: KottiI18n.Messages = {
HIDDEN: '',
INVALID: 'Invalid',
NOT_STARTED: 'Not started',
READY_TO_UPLOAD: 'Ready to upload on submittal',
UPLOADED: 'Uploaded',
UPLOADED_WITH_ERROR: 'Uploaded with error',
UPLOADING: 'Uploading...',
READY_TO_UPLOAD: 'Ready to upload on submittal',
},
text: {
clickToUpload: 'Click to upload',
Expand All @@ -88,8 +88,8 @@ export const enUS: KottiI18n.Messages = {
},
KtFieldSelects: {
loadingText: 'Loading',
noMatchText: 'No matching data',
noDataText: 'No results',
noMatchText: 'No matching data',
placeholder: 'Select',
},
KtFilters: {
Expand Down
46 changes: 23 additions & 23 deletions packages/kotti-ui/source/kotti-i18n/locales/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ module Common {
GREATER_THAN_OR_EQUAL: 'es mayor o igual a',
IS_EMPTY: Common.isEmpty,
LESS_THAN: 'es menor que',
LESS_THAN_OR_EQUAL: 'es menor que o igual a',
LESS_THAN_OR_EQUAL: 'es menor o igual a',
}

export const restrictedAccess = 'Acceso restringido'
}

export const esES: KottiI18n.Messages = {
KtBanner: {
expandLabel: 'Ver',
expandCloseLabel: 'Cerrar',
expandLabel: 'Ver',
},
KtComment: {
cancelMessage: 'Presione la tecla Esc o',
cancelMessage: 'Pulse la tecla Esc o',
clickToCancelLabel: 'haga clic para cancelar',
deleteButton: 'Borrar',
editButton: 'Editar',
Expand All @@ -40,15 +40,15 @@ export const esES: KottiI18n.Messages = {
acceptPhoto: 'Usar Foto',
cancel: 'Cancelar',
nextCamera: 'Siguiente CΓ‘mara',
rejectPhoto: 'Retomar Foto',
rejectPhoto: 'Volver a tomar Foto',
retry: 'Reintentar',
takePhoto: 'Tomar Foto',
},
error: {
multipleNotAllowed: 'Carga de mΓΊltiples archivos no permitida',
multipleNotAllowed: 'No se permite cargar mΓΊltiples archivos',
notAllowed: 'Permiso denegado para usar la cΓ‘mara',
notFound: 'No se encontrΓ³ ninguna cΓ‘mara disponible',
notSupported: 'No se encontrΓ³ ninguna cΓ‘mara compatible',
notFound: 'No se ha encontrado ninguna cΓ‘mara disponible',
notSupported: 'No se ha encontrado ninguna cΓ‘mara compatible',
},
label: {
capture: 'Tomar Foto',
Expand All @@ -59,53 +59,53 @@ export const esES: KottiI18n.Messages = {
},
statusMsg: {
CANCELED: 'Cancelado',
ERROR: 'La carga fallΓ³, por favor intente nuevamente',
ERROR: 'Carga fallida, por favor intΓ©ntelo de nuevo',
HIDDEN: '',
INVALID: 'InvΓ‘lido',
NOT_STARTED: 'No iniciado',
READY_TO_UPLOAD: 'Listo para cargar en el envΓ­o',
UPLOADED: 'Cargado',
UPLOADED_WITH_ERROR: 'Cargado con error',
UPLOADING: 'Cargando...',
READY_TO_UPLOAD: 'Listo para cargar en el envΓ­o',
},
text: {
clickToUpload: 'Haga clic para cargar',
dragAndDrop: 'o arrastre y suelte',
learnMore: 'Aprender mΓ‘s',
learnMore: 'MΓ‘s informaciΓ³n',
max: 'mΓ‘x.',
},
validationMsg: {
INVALID_EXTENSION: 'Formato de archivo no soportado',
MAX_SIZE_EXCEEDED: 'TamaΓ±o mΓ‘ximo de archivo permitido excedido',
INVALID_EXTENSION: 'Formato de archivo no compatible',
MAX_SIZE_EXCEEDED: 'Se ha excedido el tamaΓ±o mΓ‘ximo de archivo permitido',
},
},
KtFieldInlineEdit: {
placeholder: 'Haga clic para editar',
},
KtFields: {
optionalLabel: 'Opcional',
requiredMessage: 'Este campo es requerido',
requiredMessage: 'Este campo es obligatorio',
},
KtFieldSelects: {
loadingText: 'Cargando',
noMatchText: 'No hay datos que coincidan',
noDataText: 'Sin resultados',
noMatchText: 'No hay datos que coincidan',
placeholder: 'Seleccionar',
},
KtFilters: {
addFilterLabel: 'Agregar Filtro',
addFilterLabel: 'AΓ±adir Filtro',
andLabel: 'Y',
boolean: {
EQUAL: 'estΓ‘',
EQUAL: Common.is,
IS_EMPTY: Common.isEmpty,
},
clearAllLabel: 'Limpiar Todo',
clearAllLabel: 'Borrar Todo',
currency: Common.number,
dateRange: {
IN_RANGE: 'estΓ‘ en el rango',
IS_EMPTY: Common.isEmpty,
},
emptyListLabel: 'No hay Filtros Aplicados',
emptyListLabel: 'No se han aplicado filtros',
filterLabel: 'Filtro',
filtersLabel: 'Filtros',
float: Common.number,
Expand All @@ -124,20 +124,20 @@ export const esES: KottiI18n.Messages = {
EQUAL: Common.is,
IS_EMPTY: Common.isEmpty,
},
unsetLabel: 'No Establecido',
whereLabel: 'Donde',
unsetLabel: 'No establecido',
whereLabel: 'DΓ³nde',
},
KtFormSubmit: {
errorsSectionTitle: 'Errores',
title: 'EnvΓ­o de formulario no permitido',
warningsSectionTitle: 'Avisos',
warningsSectionTitle: 'Advertencias',
},
KtNavbar: {
menuCollapse: 'Colapsar menΓΊ',
menuCollapse: 'Contraer el menΓΊ',
menuExpand: 'Expandir el menΓΊ',
quickLinksTitle: 'Enlaces rΓ‘pidos',
},
KtValueLabel: {
notSet: 'No establecido',
notSet: 'No Establecido',
},
}
6 changes: 3 additions & 3 deletions packages/kotti-ui/source/kotti-i18n/locales/fr-FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ module Common {

export const frFR: KottiI18n.Messages = {
KtBanner: {
expandLabel: 'Voir',
expandCloseLabel: 'Fermer',
expandLabel: 'Voir',
},
KtComment: {
cancelMessage: 'Appuyez sur la touche Esc ou',
Expand Down Expand Up @@ -63,10 +63,10 @@ export const frFR: KottiI18n.Messages = {
HIDDEN: '',
INVALID: 'Invalide',
NOT_STARTED: 'Pas commencΓ©',
READY_TO_UPLOAD: 'PrΓͺt Γ  Γͺtre tΓ©lΓ©chargΓ©',
UPLOADED: 'TΓ©lΓ©chargΓ©',
UPLOADED_WITH_ERROR: 'TΓ©lΓ©chargΓ© avec erreur',
UPLOADING: 'TΓ©lΓ©chargement...',
READY_TO_UPLOAD: 'PrΓͺt Γ  Γͺtre tΓ©lΓ©chargΓ©',
},
text: {
clickToUpload: 'Cliquer pour tΓ©lΓ©charger',
Expand All @@ -88,8 +88,8 @@ export const frFR: KottiI18n.Messages = {
},
KtFieldSelects: {
loadingText: 'Chargement',
noMatchText: 'Aucune correspondance',
noDataText: 'Aucun rΓ©sultat',
noMatchText: 'Aucune correspondance',
placeholder: 'Choisir',
},
KtFilters: {
Expand Down
7 changes: 3 additions & 4 deletions packages/kotti-ui/source/kotti-i18n/locales/ja-JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ module Common {

export const jaJP: KottiI18n.Messages = {
KtBanner: {
expandLabel: '葨瀺',
expandCloseLabel: 'ι–‰γ˜γ‚‹',
expandLabel: '葨瀺',
},
KtComment: {
cancelMessage: 'Escγ‚­γƒΌγ‚’ζŠΌγ™γ‹',
Expand Down Expand Up @@ -63,10 +63,10 @@ export const jaJP: KottiI18n.Messages = {
HIDDEN: '',
INVALID: 'η„‘εŠΉ',
NOT_STARTED: '始まっていγͺい',
READY_TO_UPLOAD: 'ζε‡Ίζ™‚γ«γ‚’γƒƒγƒ—γƒ­γƒΌγƒ‰γ™γ‚‹ζΊ–ε‚™γŒγ§γγΎγ—γŸ',
UPLOADED: 'γ‚’γƒƒγƒ—γƒ­γƒΌγƒ‰ζΈˆγΏ',
UPLOADED_WITH_ERROR: 'γ‚¨γƒ©γƒΌγ§γ‚’γƒƒγƒ—γƒ­γƒΌγƒ‰γ•γ‚ŒγΎγ—γŸ',
UPLOADING: 'をップロード中...',
READY_TO_UPLOAD: 'ζε‡Ίζ™‚γ«γ‚’γƒƒγƒ—γƒ­γƒΌγƒ‰γ™γ‚‹ζΊ–ε‚™γŒγ§γγΎγ—γŸ',
},
text: {
clickToUpload: 'γ‚―γƒͺックしてをップロード',
Expand All @@ -88,11 +88,10 @@ export const jaJP: KottiI18n.Messages = {
},
KtFieldSelects: {
loadingText: 'ロード中',
noMatchText: 'データγͺし',
noDataText: 'η΅ζžœγŒγ‚γ‚ŠγΎγ›γ‚“',
noMatchText: 'データγͺし',
placeholder: 'ιΈζŠžγ—γ¦γγ γ•γ„',
},
// TODO check KtFilters translations
KtFilters: {
addFilterLabel: 'γƒ•γ‚£γƒ«γ‚Ώγ‚’θΏ½εŠ ',
andLabel: 'そして',
Expand Down
Loading

0 comments on commit 720b4cf

Please sign in to comment.