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

Translations do not end up in cache and used as keys #1060

Closed
shanginn opened this issue Jan 13, 2024 · 3 comments · Fixed by #1062
Closed

Translations do not end up in cache and used as keys #1060

shanginn opened this issue Jan 13, 2024 · 3 comments · Fixed by #1062
Assignees
Labels

Comments

@shanginn
Copy link

It's easier to show on example

repo with reproduction: https://github.com/shanginn/spiral-translator-test

Testing on ru encoding and the file app/locale/ru/messages.ru.php.

There are 3 translations:

'string in template' => 'строка в шаблоне',
'string using l' => 'строка используя l',
'string using say' => 'строка через trait и say',

The 'string in template' is used in the template home.dark.php and during the translation compilation, it gets cached, all good.

The other 2 are used in app/src/Domain/User/Exception/WithLTestException.php and app/src/Domain/User/Exception/WithSayTestException.php respectively.

And during the translation compilation using:

php app.php i18n:reset
php app.php i18n:index ru

they do not get cached but appear "as is", i.e., as keys:

// runtime/cache/i18n.ru.php
'string in template' => 'строка в шаблоне',
'string using l' => 'string using l',
'string using say' => 'string using say',

PS
The application skeleton is created with the file app/locale/ru/messages.en.php which I renamed to app/locale/ru/messages.ru.php, but even with the old filename, the result is the same.

Additional Info

Q A
Framework Version 3.11.1
PHP version 8.3
Operating system MacOS
@msmakouz
Copy link
Member

@shanginn Hi, could you test the dev version from the master branch? The issue should be fixed.

@shanginn
Copy link
Author

hi
looks like it works fine on dev-master version 👍

@msmakouz
Copy link
Member

@shanginn Thanks!

Closed by: #1062

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

Successfully merging a pull request may close this issue.

2 participants