Remove empty locale folders in gettext:regenerate
What does this MR do?
Addresses: #238208 (closed)
- Remove empty locale folders when running
gettext:regenerate
- Add specs for the
gettext
tasks - Move some common variables to helper methods
Prior to this change, gettext:regenerate
would do the following (these are example locales):
locale
en_NZ
- gitlab.po # deleted and regenerated during task
- gitlab.po.timestamp # gitignored (no change)
- gitlab.po.edit # gitignored (no change)
en_US
- # 🚨 didn't exist at the start, created during and then deleted at the end of the task
- gitlab.po.timestamp # gitignored (no change)
- gitlab.po.edit # gitignored (no change)
- gitlab.po
Regenerating the en_US/gitlab.po
file is really time consuming and ultimately un-necessary, as we do not support translations in that locale (which is why there is no .po
file)
After this change:
locale
en_NZ
- gitlab.po # deleted and regenerated during task
- gitlab.po.timestamp # gitignored (no change)
- gitlab.po.edit # gitignored (no change)
en_US # 🚨 deleted at start of task
- # * doesn't exist, is not created
- gitlab.po.timestamp # * deleted at start of task
- gitlab.po.edit # * deleted at start of task
- gitlab.po
At the start of the task we delete the en_US
folder entirely, so that we don't waste time regenerating it's gitlab.po
file.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
~~Label as security and @ mention @gitlab-com/gl-security/appsec
~~ -
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Josianne Hyson