Skip to content

Remove empty locale folders in gettext:regenerate

Josianne Hyson requested to merge jh-clean_gettext_regen into master

What does this MR do?

Addresses: #238208 (closed)

  1. Remove empty locale folders when running gettext:regenerate
  2. Add specs for the gettext tasks
  3. 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

Availability and Testing

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

Merge request reports

Loading