Open rodzy opened 4 years ago
Hi @rodzy. We are thinking of integrating Crowdin for easier translation management. Do you maybe have any experience at the configured level?
Hi @tehKapa. I'm catching up with the Crowdin documentation right now. As soon I have it done I notify you guys on Slack
The main issue is finding a way to implement a translation template to the current code structure.
The best way in this case is to use JSON file instead of ts files for translations
And use this https://www.npmjs.com/package/react-i18next for import json?
Why do you want to add it ? To use JSON files? If I remember well i18next is enough
You're probably right (I'm not a developer, I'm in charge of management and CI/CD).
Btw, I leave here a reference link https://github.com/i18next/react-i18next/issues/472
It is not a problem :). About the implementation I think that with .json is simpler than with .ts. As i suggested here #1919 Docusaurus is using this service. @rodzy I think that you can take a look their implementation.
I was messing with the .ts files yesterday and it's definitely challenging, because Crowdin only uses string recognition and some times picks the type properties as strings that in mind changes the flow results on not displaying any data on the end application. I might try using .json , thx for the suggestion on Docusaurus @marcosvega91, I'm definitely checking their implementation.
I have made a little test about this point. Crowdin has a built-in integration with github. You can choose the branch from which Crowdin should be synched then Crowdin will create PR with translations. I think that the only thing to do is to create JSON files and than someone should configure Crowdin
Ok. I am going to explore Crowdin this evening and then we will make the final decision. Thanks for working on this. Speaking about TS vs JSON, since now there were any difference for us but TS was more flexible, however if JSON integrates better with external platforms we are going to refactor the translations.
Speaking of Crowdin configuration, the other day I was digging a bit on it an got some things done on a test crowdin.yaml file with the Crowdin CLI using my personal account.
From that there are some thing to consider:
Having a public HospitalRun project or an organization on https://crowdin.com would be great from the start to make the config file way faster and generate the general API key for the organization and the project repository itself.
Having just one JSON file with en-US translation and from that file we can generate all the other translations, Crowdin generates the other translations into the specified folders.
To make it better to work with dynamic data with the current translation module (i18n) that uses the TypeScript files already defined, we can modify the current .ts files or implement a interface or a class to store the data into TypeScript.
Example:
import jsonObject from './todo.json';
// Defining our Todo class
class Todo {
userId: number;
id: number;
title: string;
done: boolean;
}
// Object.assign() will clone jsonData into
// Todo class object Storing the new class
// object in a typescript variable
let newTodo = Object.assign(new Todo(), jsonData);
// Logging the output onto the console
console.log(newTodo);
Output:
Todo {
userId: 1,
id: 1,
title: 'Some data',
done: true
}
@tehKapa Stay far away from Crowdin, see https://github.com/jitsi/jitsi-meet/issues/5056#issuecomment-612239691 Use Weblate instead :)
@comradekingu thanks for the advice!
Here we are! Weblate support has lightning-fast activated a Libre account https://hosted.weblate.org/projects/hospitalrun/
@rodzy @marcosvega91 unfortunately it was better to change service, I hope that the work done on Crowdin can be reused
@tehKapa Better idea that discovering the quality isn't good. I can help populate it if you add https://hosted.weblate.org/user/kingu/ as an admin :) Only started helping projects this way, but got two projects up and running in as many days.
Thanks, @comradekingu for pointing this out. As a project that will be used by final users, we need to pay more attention to who we rely upon!
I couldn't agree more, we should watch out for this kingu guy ;)
@comradekingu I've added you to Weblate project
So from what I can tell .ts Qt Linguist files are supposed to be different from the ones found in this repo. No luck adding those.
Start tag expected, '<' not found, line 1, column 1 (<string>, line 1) src/shared/locales/de/translations/actions/index.ts: Start tag expected, '<' not found, line 1, column 1 (<string>, line 1) src/shared/locales/enUs/translations/actions/index.ts: Start tag expected, '<' not found, line 1, column 1 (<string>, line 1) src/shared/locales/es/translations/actions/index.ts: Start tag expected, '<' not found, line 1, column 1 (<string>, line 1) src/shared/locales/fr/translations/actions/index.ts: Start tag expected, '<' not found, line 1, column 1 (<string>, line 1) src/shared/locales/id/translations/actions/index.ts: Start tag expected, '<' not found, line 1, column 1 (<string>, line 1) src/shared/locales/it/translations/actions/index.ts: Start tag expected, '<' not found, line 1, column 1 (<string>, line 1) src/shared/locales/ja/translations/actions/index.ts: Start tag expected, '<' not found, line 1, column 1 (<string>, line 1) src/shared/locales/ptBr/translations/actions/index.ts: Start tag expected, '<' not found, line 1, column 1 (<string>, line 1) src/shared/locales/ru/translations/actions/index.ts: Start tag expected, '<' not found, line 1, column 1 (<string>, line 1) src/shared/locales/zhCN/translations/actions/index.ts: Start tag expected, '<' not found, line 1, column 1 (<string>, line 1)
what are the steps you have done?
I added a component with settings I think would otherwise have worked. Tried both with wildcards for component and language, and adding just one component at a time. I can post the settings if you like.
yep, it would be useful
Hi guys, I'm new to this project and to be honest also new to "contributing on GitHub" in general. I saw that there are missing some German translations and wanted to ask if I could help you adding them ?
Hi @client-side96. We wanted to use Weblate to make translation easier, but everything remained on standby. Actually, we manually translate files with the various labels, like this PR: https://github.com/HospitalRun/hospitalrun-frontend/pull/2661
🚀 Feature Proposal
To add some of the missing translations on the script files, can I start working on them or you guys planning on doing it a different way?
Motivation
I've seen some traction for this repository on some Facebook front-end groups and they were talking about the missing languages , so I've been studying the code and would like to collaborate