Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use translation files instead of hard-coding #5

Open
littlegolden opened this issue Oct 2, 2021 · 3 comments
Open

Use translation files instead of hard-coding #5

littlegolden opened this issue Oct 2, 2021 · 3 comments

Comments

@littlegolden
Copy link

Looks like the UI content is currently hard coded, any plans to use translated files?

@SychO9
Copy link
Member

SychO9 commented Oct 2, 2021

They're not hardcoded, they're part of afrux-theme-base which is the base package which will be used across afrux themes :)

https://github.com/afrux/flarum-theme-base/blob/master/locale/en.yml

@rob006
Copy link

rob006 commented Oct 2, 2021

That is a bit tricky from language pack perspective, because Flarum will load only translations from enabled extensions. Since afrux/flarum-theme-base is not even an extension, it won't work if we include translations in afrux-theme-base.yml file, we need to include them in afrux-asirem.yml. If you create 10 themes which uses afrux/flarum-theme-base, these translations will need to be duplicated 10 times in language pack (each theme will need its own copy in its YAML file), with possible conflicts and inconsistencies (they will share the same keys).

It would be much easier for translators to mark afrux/flarum-theme-base as actual extension and handle translations in standard way.

@SychO9
Copy link
Member

SychO9 commented Oct 2, 2021

Hmm, interesting, it makes sense that not everything is loaded from language packs, the amount of translations across so many extensions can easily become huge. That said I don't want to have that package be an extension, I imagine it'll be confusing.

The best thing would be to have something in core to allow this use case, I think it's a valid one. I might be able to hack something in the code from my side to have the afrux-theme-base.yml loaded from language packs.

I created an issue in the core repository https://github.com/flarum/core/issues/3091, and if I have time I'll try implementing a temporary solution on my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants