humhub / translation

Internal translation tool
https://translate.humhub.org
Apache License 2.0
17 stars 15 forks source link

Could not translate external modules from different folder #41

Open yurabakhtin opened 3 years ago

yurabakhtin commented 3 years ago

When I clone some external module from GitHub it is cloned by default in to the folder with prefix humhub-modules-:

module_dirs

and the modules works well, but this module cannot find the message files from such folders because it expects if module has an ID = twofa then the message files are located in the folder twofa too and not in humhub-modules-twofa:

error

Do we really need the 3rd restriction?

buddh4 commented 3 years ago

Since the module was designed to only be used in our translation environment I wanted to make it as strict as possible in order to prevent any kind of vulnerability, feel free to loosen the restriction as long as you don't open any vulnerabilities. Maybe you could disable some restrictions by configurations?

yurabakhtin commented 3 years ago

@buddh4 If we want to keep the 3rd condition || !$this->validateParent($moduleId, $expectedModuleId) then I can suggest this solution https://github.com/humhub/humhub-modules-translation/pull/42.