Opened 2 years ago

Closed 23 months ago

#6231 closed change (fixed)

[CMS] Add tests for translation string substitution

Reported by: kvas Assignee: kvas
Priority: P3 Milestone:
Module: Sitescripts Keywords:
Cc: jsonesen Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29659605/

Description

Background

Translation string substitution is one of the most complicated parts of CMS codebase. Apart from the base functionality there is a number of additional features:

  • Fixed text: #2112,
  • Default translations: #2133,
  • Nested translations: #2139,
  • Resolving links in translation strings: #2323,
  • Reuse of default values: #2936,

and possibly something else that I have missed, as well as interesting corner cases that have lead to bugs before:

  • Extra semicolons being added to translatable strings #2450,
  • Translatable attributes are escaped twice #2457.

At the same time, we only have one test for translation string substitution and it only checks the basic functionality. This is not enough.

What to change

Add tests for the aforementioned features and bugs. Check if they cover the entirety of the code that does translation string substitution and cover any missing bits too.

Implementation notes

Existing testing framework based on testing source pages and expected outputs should be sufficient for the testing of translation string substitution. Try to stick to it without adding any Python code and keep the new additions down to a small number of pages as much as possible.

Change History (5)

comment:1 Changed 2 years ago by kvas

  • Cc jsonesen added

comment:2 Changed 2 years ago by kvas

  • Owner set to kvas

comment:3 Changed 23 months ago by kvas

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:4 Changed 23 months ago by abpbot

A commit referencing this issue has landed:
Issue 6231 - Add tests for translation string substitution

comment:5 Changed 23 months ago by kvas

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.