ChristophP / elm-i18next

https://package.elm-lang.org/packages/ChristophP/elm-i18next/latest
BSD 3-Clause "New" or "Revised" License
66 stars 12 forks source link

Question : Is there a way to generate the JSON files automatically? #25

Closed francois90 closed 3 years ago

francois90 commented 3 years ago

It would be great to be able to do so like with gettext.

Thanks

ChristophP commented 3 years ago

Hi @francois90 ,

I've never used gettext before but I can say that this lib does not generate any files. It was built to consume JSON files that already existed.

So generating files was never the intention here but I do agree that it's a useful thing to have in certain cases. If you're interested in exploring things in this direction and/or you have concrete use case in mind I am open to hearing them.

Cheers, Christoph

francois90 commented 3 years ago

Thanks for your reply Christoph,

I'm just looking to optimize my workflow. I never used gettext before either but it seems really nice. It generates template files that you can import in a translation management system such as weblate or transifex and have your community help with translating in multiple language and export language files from there in any format.

I'm curious, do you usually use a tool to generate the JSON files or do you write them manually?

Thanks

ChristophP commented 3 years ago

Hi @francois90 ,

I see. I haven't dealt with translations much in the past 2 years tbh. But at my previous job (where I built the library) we used a tool called lingohub to manage the translation files with the tool's editor. It then allowed exporting the files as JSON like you mentioned and we committed those into our source control. Wheneever there were changes the tool or the translator would create a PR to our repository, it would be reviewed by a dev and then merged.

So were the files created manually or generated? It depends. Usually the initial (english) version was created manualle by a developerm but additional languages were created inside lingohub by an translator and then exported into out codebase.

Hope that helps a bit

ChristophP commented 3 years ago

@francois90 Let me know if you want do discuss more. If not I will close this issue in a few days.

francois90 commented 3 years ago

Thank you Christophe for your answers. We hacked a little script for converting a csv file into json translation files for now.