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

Translation fallbacks not working #450

Open
mrmurnst opened this issue Dec 27, 2023 · 0 comments
Open

Translation fallbacks not working #450

mrmurnst opened this issue Dec 27, 2023 · 0 comments

Comments

@mrmurnst
Copy link

Hi @craigk5n,

while trying to get v1.9.10 to run, I stumbled upon a problem with translations already described in #448:
In includes/classes/WebCalendar.php the method _initTranslate fails because translate('charset') doesn't return anything when not using English.
You fixed that for #448 in 399dd1c by explicitly setting the charset in all language files, but that's just a symptom for fallbacks to the English defaults generally not working.

Seems like the problem was introduced in 3889507 in includes/translate.php where you added to read_trans_file:

$translations = [];

This resets the global translations array, which should only be augmented when loading a second file after the English default, I think...

I replaced that with

if (!is_array($translations))
  $translations = [];

and it started working again...
Maybe that's already the full solution. I'm not totally sure what your intention in that recent commit was, though.

Best wishes and thanks for still working on WebCalendar. ;)

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

1 participant