Azgaar / Armoria

Heraldry generator and editor
https://azgaar.github.io/Armoria
273 stars 30 forks source link

Use the Github integration feature of Crowdin to allow offline use? #72

Closed EternityForest closed 2 years ago

EternityForest commented 2 years ago

At the moment it looks like Armoria requests a translation file from a CDN. Could this: https://support.crowdin.com/github-integration/ be used to remove the cloud dependency?

Azgaar commented 2 years ago

Hello, it makes sense, we can integrate Clowding with Armoria to add files locally. CDN was selected as it's really easy to update. With integration there should be some additional ci step, I will check it out.

Azgaar commented 2 years ago

I have established the integration, so localization files are create and moved to master, see https://github.com/Azgaar/Armoria/tree/master/public/locales. The problem is that there is no list of languages available and it's not obvious how UI will get this data. Checking CDN is not an option and there should be just 1 flow to follow.

Azgaar commented 2 years ago

Generally it looks we will have to request manifest from CDN in any case

Azgaar commented 2 years ago

Sounds a bit overcomplicated, but probably we can create github action to fetch manifest, get a list of languages and add it to the public folder. Something like that: https://github.com/hangwoo/crowdin-translation-progress/blob/master/index.js Or that: https://github.com/marketplace/actions/fetch-api-data

Azgaar commented 2 years ago

@EternityForest, I see you are working on the idea. I believe there is a good way to get languages and other info using Crowding API. It's simple and very powerful. Using it we can automate the whole flow, including locale files download

Azgaar commented 2 years ago

I also see that you trying to create a manifest. Generally we don't need to do it, we just need a simple array of language codes. It can be comma-separated one-liner txt/csv or json. Or even js file to load it directly in UI without need to fetch.

Azgaar commented 2 years ago

Hello @EternityForest,

I have merged the PR and made some changes to the workflow. Mainly to be able to trigger it manually in case of issues. Also set relative path to the locales directory. Now it should be ok.

The only issue is that I had to manually reupload all translations to Crowding a source file was changes. So we lost all the comments.

Thanks for the help with it!