Closed Mecanik closed 9 months ago
Hello Mecanik, thanks for your issue and your interest for Hugolify,
I have some questions to better understand your issue (after some tests I wasn't able to reproduce) :
admin/app/config/locale.js
or maybe other files related to Hugolify theme ?To clarify, we have two things related to languages in the cms :
config/locale.js
: to select in what language the cms interface will be translated AND to select what is the default language to write contentparameters/available-languages.js
: to define in what languages you will be able to write your content with decap cms.I hope my comment will help to solve the problem or to better understand the issue, let me know if I missed something. Thanks
Hello,
The documentation does not talk about admin/app/config/locale.js
only available-languages.js
(from what I can see), so I haven't touched locale.js
yet.
The issue is that the CMS is only available in French and no English. After trying to edit available-languages.js
, if you leave only 'en'
the admin area won't load anymore. Errors are present in the console. If you leave 'fr'
, 'en' then the admin area loads and you can edit content in both FR and EN.
Now for the life of me I cannot understand why the admin area works now and it didn't yesterday, maybe you updated something?
Thanks
Hello,
Thanks for your informations.
To change the language of the cms ui, you need to change the locale in admin/app/config/locale.js
.
You can set it to 'en' to get CMS in English.
Currently, this is not in the documentation so I'll add it. Thanks for having noticed it.
I think the errors was caused by the cache, because we didn't update the module yesterday and I cannot reproduce the error with informations you given.
I tested (and cleared cache after relaunched servers) :
locale='fr',
availableLanguages = ['fr']
: display french ui as expected, edit french contentlocale='fr',
availableLanguages = ['fr', 'en']
: display french ui as expected, edit french and english contentlocale='en',
availableLanguages = ['en']
: display english ui as expected, edit english contentlocale='en',
availableLanguages = ['en', 'fr']
: display english ui as expected, edit english and french content Please note that the order in availableLanguages define the order of languages in content edition
If errors remains, please let me know by sharing your availableLanguages and locale.
@arthaud-proust shouldn't we put this locale
variable in availableLanguages
?
@arthaud-proust shouldn't we put this
locale
variable inavailableLanguages
?
I would argue to keep different files because they aren't of same concern :
But locale is used for i18n config to set default for available languages. I think this is an issue because we are merging two variable of separated concerns in this file.
I see two ways :
available-langues.js
to set defaultLanguage for i18n. So that locale is only used to set cms ui language.To respect separation of concerns I propose to go on the 1.
The current configuration system is OK, I just did not look at /admin/app/config/locale.js
because it wasn't mentioned in the docs. Frankly, most people don't even read the docs... but when someone does read it, it would be nice to mention it.
Problem solved now and the CMS works in English and the main site as well.
Thanks
Hello,
Thank you for this amazing project. Please note that if you set the default language to
en
the/admin
will not load anymore.Furthermore, even if you use
fr
anden
as available languages, only the fr loads.Thanks