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

internationalisation is broken again #2641

Open
SingingBush opened this issue Jan 28, 2022 · 5 comments
Open

internationalisation is broken again #2641

SingingBush opened this issue Jan 28, 2022 · 5 comments

Comments

@SingingBush
Copy link

I have .po files in a project which had worked for years but noticed today that at some point the internationalisation has stopped working. This was also a problem back in 2016, see: #1555

@s-ludwig
Copy link
Member

We should definitely make sure that a test case ends up in the test suite this time if it is caused by a bug. My guess though is that this is caused by introducing context strings in diet-ng: rejectedsoftware/diet-ng#92

The fact that this breaks existing PO files is very unfortunate, maybe this needs a compatibility transition phase.

@SingingBush
Copy link
Author

thanks for the quick response. I've looked at PR #2585 so can now see what needs to be changed re msgctxt. Could it perhaps default to some kind of global context?

@SingingBush
Copy link
Author

This has become a bit of a problem. When I have translations that are only used on a single page, using msgctxt is fine.

msgctxt "index"
msgid "home.welcome-message"
msgstr "Welcome to the site"

but for text that is needed all over the site, such as "Submit" being on the button of a form I've not found a way to define the string once and access it from multiple pages. I saw the use of a trWeb function in /examples/web-i18n/views/home.dt but it didn't work for me.

@s-ludwig
Copy link
Member

One way would be to outsource the submit button to either an "extends" or "include" template. The context should always be the original source code file and not the top level one being compiled.

@SingingBush
Copy link
Author

ok thanks

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