LAION-AI / Open-Assistant

OpenAssistant is a chat-based assistant that understands tasks, can interact with third-party systems, and retrieve information dynamically to do so.
https://open-assistant.io
Apache License 2.0
36.92k stars 3.22k forks source link

Write a script to sync translation in EN with other locales #3077

Closed notmd closed 1 year ago

notmd commented 1 year ago

The script should accept an option locales params, example signature in TS

type Params = {
  locales?: string[]
}
notmd commented 1 year ago

or it would be great if anyone can setup a free i18n management service, thing like https://localazy.com

stefangrotz commented 1 year ago

Yeah, I would also prefer a TMS like pontoon or weblate. I never tried localazy, but it looks fine too. A script would be a great tool in the meantime, though. It's hard to find all missing strings just by comparing the JSONs.

olliestanley commented 1 year ago

Does this not already exist?

https://github.com/LAION-AI/Open-Assistant/blob/main/scripts/frontend-development/find-missing-locales.py

notmd commented 1 year ago

Does this not already exist?

https://github.com/LAION-AI/Open-Assistant/blob/main/scripts/frontend-development/find-missing-locales.py

It only allows to find untranslated words, not sync with the EN to remove staled words (words that in the other locales but get deleted in EN). We can extend to support this behavior

NiklasBuchfink commented 1 year ago

I would like to set up inlang for Open-Assistant by just adding an inlang.config.js. This would give contributors and translators the ability to edit translations in a frontend and make pull requests to Open-Assistant without overhead for maintainers. It comes with default lint rules that mark missing translations or outdated references.

Here is a preview, with a sample project: https://inlang.com/editor/github.com/inlang/example

In addition, other useful tools are supported to make i18n easier like a VS Code plugin (in the next days) and a CLI.

Let me know and I'll set it up for you 🙂

notmd commented 1 year ago

@NiklasBuchfink does it compatible with next-i18next?

NiklasBuchfink commented 1 year ago

@notmd Yes, I have already set it up several times with i18n-next and there will be a custom integration for i18n-next in the future, as mentioned 👍

felixhaeberle commented 1 year ago

@notmd I'm currently building a i18n-next plugin with inlang that users from i18n-next can use the inlang IDE extension to massively speed up their workflow and use the git-based online editor. 🎉 see https://inlang.com for more

notmd commented 1 year ago

@notmd Yes, I have already set it up several times with i18n-next and there will be a custom integration for i18n-next in the future, as mentioned 👍

Then please help us setup, thank you!

stefangrotz commented 1 year ago

Looks very simple, just create a json file that defines the reference language: https://inlang.com/documentation/getting-started

After that it should be able to use it with this URL https://inlang.com/editor/github.com/LAION-AI/Open-Assistant/

Only the i18n-next plugin plugin is missing rn, right?

NiklasBuchfink commented 1 year ago

@stefangrotz That's right, the i18n-next plugin is currently under development. But there is also a json plugin that works for this use case. I still need to extend it a bit to support the {language}/*.json folder structure. I`m working on that right now.

NiklasBuchfink commented 1 year ago

@notmd @stefangrotz It took a little longer, but the time was used to optimize everything for a project like Open-Assistant.

Now I have created the PR. Please let me know if I should change something.