Closed DanielDarrenJones closed 11 months ago
That’s strange. Would you be able to provide a repository that shows the issue?
@ryanmitchell It seems to break if you add the lang files directly under resources/lang
I have added two files an en_GB.json
and en_US.json
both with the following content:
{
"accommodation-grid.no-results": "No accommodation found."
}
I'm not using a folder here as I don't need to separate the translations out and don't want to have to prefix all my translations, this works in the frontend fine.
If I add the folder eg. resources/lang/en_GB/site.json
then the manager loads properly, however I then need to prefix all my translations with site.
eg site.accommodation-grid.no-results
Translations in the json file are not meant to be dotted - you should use strings not keys. See: https://laravel.com/docs/10.x/localization#using-translation-strings-as-keys
I don't think this is the issue, it still doesnt work, even when not using dot seperation eg:
{
"This is a test.": "No accommodation found."
}
Expected behavior: Translations to be loaded and shown in the plugin control page.
Actual behavior: No items are shown, and no translations are found:
Reproduce steps: Add translations .json file to lang folder, I have added an en.json, and then used the translation in the antlers code like so
{{ trans key="accommodation-grid.no-results" }}
, I have then gone to the control panel and its not displaying any items and not finding any translations when I click either button.I'm not sure if I am missing a installation step? But SQLite is installed and this isn't working across 3 environments (2 local, 1 on Laravel Forge).
Version: ryanmitchell/statamic-translation-manager: 1.2.1
Additional Information: (Additional information, if any)