Closed quelo83 closed 8 months ago
Hey @quelo83 will take a look on that and find if that is possible to add to the plugin.
Thanks.
Thank you very much @xiCO2k. This would be a fantastic improvement.
I've not tested yet, but it seems that the only changes would be to modify the function header to accept an array of langPaths:
export default function i18n(langPath: string|string[] = 'lang') {
and replace the line 22:
files = parseAll(langPath)
with this code:
let langPaths = Array.isArray(langPath) ? langPath : [langPath];
langPaths.forEach(langPath => {
files = files.concat(parseAll(langPath));
});
Let me know if I can help you in any way.
++ need this feature also
+1 also it could help to exclude some unwanted in frontend files as for example validation
Hi I also look for this kind of features. I would like to be able to load lang files in a specific context. Indeed, a single lang file become quickly big impacting performance. Having the opportunity to load multiple lang files by module is an important feature for me. For example there is no need to load translations related for one shot Vue 3 pages like setup checks every time in the other Vue 3 pages components are loaded.
Don't think I have the time to take a look on this, will be glad to check a PR.
I got the same issue with modules exported to lang/vendor/...
would a pr for the above work?
as a temp fix going to publish inside the lang/en/
folder
Hi, my project uses the Laravel Modules package (https://github.com/nWidart/laravel-modules) which allows you to separates logic in different modules. This means that every module has its own lang files.
The problem is that it is not possible to specify more than one folder for PHP files in the Vite plugin.
It would be perfect if it accepts an array of LangPaths in order to process more than one folder.
Is this a possible change?