Clean-up translations directory

Created on 6 March 2018, about 7 years ago
Updated 27 March 2023, almost 2 years ago

Problem/Motivation

Interface translation files get saved into the translations directory. But the files are only removed when a module is disabled or a language gets removed. But during the life time of a module (usually the life time of a site) translation files remain into the translations directory. The translation file name contains the module version number, translations files are unique per (stable) release. Therefore with each update a new file, with a different file name, will be stored and old files fill-up the directory (e.g. token-8.x-1.0-beta1.nl.po, token-8.x-1.0-beta3.nl.po, token-8.x-1.0.nl.po).

There is another case of file cluttering that originates from a bug to be fixed in #2949825: Downloaded translation file should replace existing β†’ . New translation files with the same name as existing files will get renamed (e.g. token-8.x-1.0.nl_0.po instead of token-8.x-1.0.nl.po). This clean-up issue can cover those files too.

Proposed resolution

Options:

  • Cron task
    Periodically remove unwanted files. Wanted and unwanted files to be distinguished using the locale_file table.
  • During download
    Before downloading a new translation, remove files that match the module name and language. The matching is done based on file name pattern.

Files from three different souces should be distinguished: Contributed modules (fix file name pattern), Custom modules (variable file name pattern), Manually uploaded translations (language known, may not be related to a module).

Remaining tasks

Postponed πŸ› A new module version is not recognized by interface translation update. Fixed

  • Choose a resolution
  • Code
  • Test
  • Review

User interface changes

Perhaps additional documentation about custom 'interface translation server pattern'

API changes

not expected

Data model changes

not expected

πŸ“Œ Task
Status

Postponed

Version

10.1 ✨

Component
LocaleΒ  β†’

Last updated 4 days ago

Created by

πŸ‡³πŸ‡±Netherlands sutharsan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    This was a bugsmash triage target today. Both Lendude and I think this should be postponed on the issue mentioned in #9. Lendude pointed out that the other issue 'needs only a few deprecations'. Also changing to a task as this is cleanup, not a bug.

    If you find yourself here, maybe you could help out in the other issue. Thx,

Production build 0.71.5 2024