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

Additional languages in themes #2877

Open
tboye opened this issue Aug 2, 2023 · 2 comments
Open

Additional languages in themes #2877

tboye opened this issue Aug 2, 2023 · 2 comments

Comments

@tboye
Copy link
Contributor

tboye commented Aug 2, 2023

Detailed Description

Disclaimer: I might be overcomplicating/misunderstanding how it's supposed to work.

In my theme for udata I'd like to add a .po file for English language so that I could tweak text by changing translations rather than msgids. But generally speaking, it's no different from a use case when someone wants to add a completely new language to their theme.

It seems to be not possible at the moment as only languages registered in udata will be taken into account and overridden by translations in the theme.

Context

When I develop a theme, I want to add languages that aren't part of udata, so I can customize theme independently.

Possible Implementation

  • let udata pick up languages from the theme once it's injected
  • let the theme add languages to udata
  • extend list of languages in udata, including English (not desirable)

Your Environment

N/A

@maudetes
Copy link
Contributor

Thank you for this issue (that wasn't on my radar, sorry).
I'm not sure I've understood it correctly though since I don't have all translation mechanic in mind.

If you want to use any language, you can override default LANGUAGES setting in your udata.cfg.
You should be able to use any of the languages that exist in udata/translations/ and it will also load translations for any theme or plugin accordingly.
What would be the use case where you don't want to have existing translations in udata?

@tboye
Copy link
Contributor Author

tboye commented Oct 12, 2023

Thanks for looking into that.

If you want to use any language, you can override default LANGUAGES setting in your udata.cfg.
You should be able to use any of the languages that exist in udata/translations/ and it will also load translations for any theme or plugin accordingly.

Yes, that's clear and that works without issues!

What would be the use case where you don't want to have existing translations in udata?

In general, my use case is to tweak translations in my theme to make them relevant to my project. Those are very small tweaks, yet still very important.

At the moment I can do it for languages that already exist in udata. If I ever come up with additional languages, they can and should be added to udata first -- it's not a problem either indeed, my ticket might sound a bit too dramatic 😅 The main problem I have at the moment is with English strings. Since English is the default language and message IDs are used directly, there's no way for me to change anything there at the moment.

Would there be any drawbacks if we register English in udata explicitly?

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

2 participants