Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 5, 2025

Many translation keys in the XLIFF files have become obsolete over time as the codebase evolved. This PR removes keys with zero occurrences in the codebase.

Approach

  • Extracted all 1797 keys from messages.en.xlf
  • Searched templates, PHP, YAML, and JS for usage
  • Accounted for dynamically generated keys (log.type.*, perm.*, settings.*, m_status.*, etc.)
  • Independently verified each key has zero matches (not relying on "obsolete" annotations)

Removed Keys

  • UI elements: admin.comment, delete.caption, edit.caption_short, tree.root_node.text
  • Part-related: part.add.caption, part.add.comment, part.withdraw.btn, part.withdraw.caption, part.withdraw.comment:, part.description.placeholder, part.instock.placeholder, part.mininstock.placeholder
  • Entity labels: project.caption, supplier.caption
  • Obsolete features: datatable.datatable.lengthMenu, search.deactivateBarcode, selectpicker.empty
  • Other: api_tokens.added_date, attachment.external_file, attachment.table.filename, part.edited_flash.invalid, part.order.price_per, r_u2f_two_factor.name, tfa_u2f.key_added_successful
  • Typo fix: validator.part_lot.location_full.no_increasment → key was fixed to no_increase

Verification

Each removed key was verified to have zero occurrences across all source files. For example:

  • part.withdraw.btn/caption/comment: are distinct from the used keys (part.withdraw.success, part.withdraw.zero_amount, part.withdraw.access_denied)
  • part.description.placeholder is distinct from the used part.edit.description.placeholder
  • r_u2f_two_factor.name is distinct from the used r_u2f_two_factor.pressbutton

Impact

~300 translation entries removed across 14 language files (~3,000 lines).

Original prompt

Look for unused/obsolete translations and remove them.
consider that many keys are dynamically generated in code, and only fractions of them are mentioned directly in code.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Removed keys:
- admin.comment
- api_tokens.added_date
- attachment.external_file
- attachment.table.filename
- datatable.datatable.lengthMenu
- delete.caption
- edit.caption_short
- part.add.caption
- part.add.comment
- part.description.placeholder
- part.edited_flash.invalid
- part.instock.placeholder
- part.mininstock.placeholder
- part.order.price_per
- part.withdraw.btn
- part.withdraw.caption
- part.withdraw.comment:
- project.caption
- r_u2f_two_factor.name
- search.deactivateBarcode
- selectpicker.empty
- supplier.caption
- tfa_u2f.key_added_successful
- tree.root_node.text
- validator.part_lot.location_full.no_increasment (typo of fixed key)

These keys have zero occurrences in the codebase and are safe to remove.

Co-authored-by: jbtronics <[email protected]>
Copilot AI changed the title [WIP] Remove unused and obsolete translations from codebase Remove 25 unused/obsolete translation keys Dec 5, 2025
Copilot AI requested a review from jbtronics December 5, 2025 10:56
@jbtronics
Copy link
Member

@copilot Do not trust the obsolete annotation, check it for yourself

Copy link
Contributor Author

Copilot AI commented Dec 5, 2025

@copilot Do not trust the obsolete annotation, check it for yourself

I re-verified each of the 25 removed keys by searching the codebase thoroughly (PHP, Twig, YAML, JS files). None of them have any occurrences in the code:

  • part.withdraw.btn, part.withdraw.caption, part.withdraw.comment: are different from the used keys (part.withdraw.success, part.withdraw.zero_amount, part.withdraw.access_denied)
  • part.edited_flash.invalid is different from the used part.edited_flash
  • part.description.placeholder, part.instock.placeholder, part.mininstock.placeholder are not used - the forms use part.edit.description.placeholder and part.edit.name.placeholder instead
  • r_u2f_two_factor.name is different from the used r_u2f_two_factor.pressbutton
  • datatable.datatable.lengthMenu, tree.root_node.text, selectpicker.empty have no occurrences

All removals have been verified independently of the "obsolete" annotations.

@jbtronics jbtronics marked this pull request as ready for review December 6, 2025 21:55
@jbtronics jbtronics merged commit 9dc17ad into master Dec 6, 2025
4 checks passed
@jbtronics jbtronics deleted the copilot/remove-unused-translations branch December 6, 2025 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants