Open wernerkrauss opened 5 years ago
Digging deeper into that issue I found that I can directly pass the resourceURL to add_i18n_javascript
like:
Requirements::add_i18n_javascript('dnadesign/silverstripe-elemental:client/lang');
Should this be added to the i18n docs?
The way you're doing is correct and should work. We do this in some of the supported modules that have frontend translations, e.g. userforms:
If you think the docs could be improved we'd welcome a PR =)
Affected Version
SS 4.3
Description
Cannot add i18 javascript using ModuleResourceLoader::resourceURL()
Steps to Reproduce
I try to add
resourceURL()
returns/resources/vendor/dnadesign/silverstripe-elemental/lang
This is treated as absolute path in
Director::getAbsFile
, therefor the lang file isn't loaded cause the file isn't found.