QUIQQER Translator import improvments - new batch import Feature
We implement a new Feature for QUIQQER - Translations
New Features
- What feature(s) did you add?
Allow batch import of packages locale XML-files
Related issue
Description
The translator is currently causing a lot of overhead while importing localization variables.
This includes, checking if the variable exists multiple times, inserting it and then executing an UPDATE query to process one localization variable.
As our localization files grow and we are issueing to many SQL-queries, we are adding even more overhead.
We want to implement a new feature to add all variables from one locale.xml file as batch in a single SQL-Query.
By reducing the overhead we will increase the performance of our setup by a large amount.
Reasons
- Timeouts during setup process on slow machines
- Reducing overhead
- Performance
Steps to implement
- Add new method \QUI\Translator::batchImport()
- Read content of
locale.xml - Build
INSERT IGNOREQuery for all locale variables.
Related issues
- quiqqer/qsetup#105 (Setup timeouts)
How did you implement it/them?
QUIQQER and the Translator have been extended with batch methods. As a result, all SQL queries were bundled and collected and sent as one query.
The complete push / commit history:
- feat: Added new method \QUI\Translator::batchImportFromPackage(). See quiqqer/package-translator#28
- fix: quiqqer/package-translator#28
- fix: quiqqer/package-translator#28
- feat: Added new method \QUI\Translator::batchImport(). See quiqqer/package-translator#28
As a result of this feature:
- The QUIQQER setup was 30 seconds faster.
- The SQL queries have been reduced by over 90%.
Posted on Utopian.io - Rewarding Open Source Contributors