Open Bug 1333445 Opened 8 years ago Updated 5 years ago

Confusing error reported by compare-locales when switching position for %d and %s (debugger.properties)

Categories

(Localization Infrastructure and Tools :: compare-locales, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

REOPENED

People

(Reporter: flod, Unassigned)

Details

https://l10n.mozilla.org/dashboard/compare?run=666999

argument 1 `S` obsolete at line 129, column 28 for sourceSearch.resultsSummary
trailing argument 2 `S` missing at line 129, column 28 for sourceSearch.resultsSummary

en-US string is: %d instances of “%S”
zh-CN string is: “%S”的 %d 个实例
Assignee: nobody → yfdyh000
Status: NEW → RESOLVED
Closed: 8 years ago
Component: compare-locales → zh-CN / Chinese (Simplified)
Product: Localization Infrastructure and Tools → Mozilla Localizations
QA Contact: shaohua.wen
Resolution: --- → FIXED
Please don't change bugs like this. 

This is a bug reported against compare-locales, and needs to be fixed independently from the localization. I CCed you to be sure you were aware of the problem.
Assignee: yfdyh000 → nobody
Status: RESOLVED → REOPENED
Component: zh-CN / Chinese (Simplified) → compare-locales
Product: Mozilla Localizations → Localization Infrastructure and Tools
QA Contact: shaohua.wen
Resolution: FIXED → ---
I looked at this, and this is non-trivial.

If someone had a good idea for an algorithm (possibly with an existing python impl) to detect permutations, that'd be great.
In the meantime, if you encounter this error you can use %2$S and %1%d to swap %d and %s in localization.

That will work with sprintf.js, and compare-locales is happy
https://github.com/juliandescottes/sprintf.js
Type: defect → enhancement
You need to log in before you can comment on or make changes to this bug.