NexoPOS
NexoPOS copied to clipboard
simplified translations
Based on the work in #1321 this now targets v5 and changes the approach such that the language files are not generated during build time anymore, but dynamically on request and then cached.
As of now this PR implements the basic functionality and works, but some things are still missing.
- [x] improve translation extraction tool to detect translation strings more reliably
- [x] provide endpoint to generate combined lang file for core and modules
- [x] cache lang file
- [ ] clear cache when enabling/disabling a module
- [ ] cleanup/remove translation symlink functionality for modules
- [ ] provide artisan command to clear lang cache
- [ ] improve translation helper for modules
- [ ] restrict locales to configured known ones
PR Summary
-
Language files moved to new directory The language files are now stored in the storage/lang folder for improved organization.
-
New controller for handling localization A LocalizationController has been created to manage localization requests and cache them for better performance.
-
Updated routes with locale pattern The routes have been updated to support locale patterns, allowing usage of valid ISO 639-1 and regional codes like en_US or fr_FR.
-
Windows systems now use hardlinks Symbolic links are no longer used on Windows systems due to compatibility issues. Hardlinks are now utilized for better performance and compatibility.
-
New route for localization file loading A new route has been added to load the localization file as necessary.
-
Removed unnecessary webpack configuration The webpack configuration has been removed as it's no longer needed.
@Blair2004 waiting for your comments on this before I continue