Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Adding missing translations (with Weblate) #2104

Open
rodzy opened this issue May 29, 2020 · 25 comments
Open

Adding missing translations (with Weblate) #2104

rodzy opened this issue May 29, 2020 · 25 comments
Labels
feature-proposal help wanted indicates that an issue is open for contributions in progress indicates that issue/pull request is currently being worked on localization LOE - medium indicates that the level of effort to complete issue is medium v2.x
Milestone

Comments

@rodzy
Copy link

rodzy commented May 29, 2020

🚀 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

@matteovivona
Copy link
Contributor

Hi @rodzy. We are thinking of integrating Crowdin for easier translation management. Do you maybe have any experience at the configured level?

@matteovivona matteovivona transferred this issue from HospitalRun/hospitalrun May 29, 2020
@matteovivona matteovivona added feature-proposal good first issue indicates an issue is good for a first time contributor help wanted indicates that an issue is open for contributions localization labels May 29, 2020
@matteovivona matteovivona added this to the v2.0 milestone May 29, 2020
@rodzy
Copy link
Author

rodzy commented May 29, 2020

Hi @tehkapa. I'm catching up with the Crowdin documentation right now.
As soon I have it done I notify you guys on Slack

@matteovivona
Copy link
Contributor

The main issue is finding a way to implement a translation template to the current code structure.

@matteovivona matteovivona changed the title Adding missing translations Adding missing translations (with Crowdin) May 30, 2020
@matteovivona matteovivona self-assigned this May 30, 2020
@marcosvega91
Copy link
Contributor

The best way in this case is to use JSON file instead of ts files for translations

@matteovivona
Copy link
Contributor

And use this https://www.npmjs.com/package/react-i18next for import json?

@marcosvega91
Copy link
Contributor

marcosvega91 commented May 30, 2020

Why do you want to add it ? To use JSON files? If I remember well i18next is enough

@matteovivona
Copy link
Contributor

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 i18next/react-i18next#472

@marcosvega91
Copy link
Contributor

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.

@rodzy
Copy link
Author

rodzy commented May 30, 2020

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.

@marcosvega91
Copy link
Contributor

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

@fox1t
Copy link
Member

fox1t commented Jun 10, 2020

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.

@rodzy
Copy link
Author

rodzy commented Jun 10, 2020

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:

  1. 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.

  2. 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.

  3. 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
}

@comradekingu
Copy link

@tehkapa Stay far away from Crowdin, see jitsi/jitsi-meet#5056 (comment)
Use Weblate instead :)

@matteovivona
Copy link
Contributor

matteovivona commented Aug 31, 2020

@comradekingu thanks for the advice!

@matteovivona matteovivona changed the title Adding missing translations (with Crowdin) Adding missing translations (with Weblate) Aug 31, 2020
@matteovivona matteovivona added 🚧blocked issue cannot be worked on for some reason LOE - medium indicates that the level of effort to complete issue is medium needs requirements indicates that an issue needs more requirements in order to be worked on v2.x and removed needs requirements indicates that an issue needs more requirements in order to be worked on 🚧blocked issue cannot be worked on for some reason labels Aug 31, 2020
@matteovivona
Copy link
Contributor

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

@comradekingu
Copy link

@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.

@fox1t
Copy link
Member

fox1t commented Sep 18, 2020

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!

@comradekingu
Copy link

comradekingu commented Sep 18, 2020

I couldn't agree more, we should watch out for this kingu guy ;)

@matteovivona
Copy link
Contributor

@comradekingu I've added you to Weblate project

@matteovivona matteovivona added in progress indicates that issue/pull request is currently being worked on and removed good first issue indicates an issue is good for a first time contributor labels Sep 19, 2020
@comradekingu
Copy link

comradekingu commented Nov 14, 2020

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)

@matteovivona
Copy link
Contributor

what are the steps you have done?

@comradekingu
Copy link

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.

@matteovivona
Copy link
Contributor

yep, it would be useful

@client-side96
Copy link

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 ?

@matteovivona
Copy link
Contributor

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: #2661

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-proposal help wanted indicates that an issue is open for contributions in progress indicates that issue/pull request is currently being worked on localization LOE - medium indicates that the level of effort to complete issue is medium v2.x
Projects
None yet
Development

No branches or pull requests

6 participants