Closed
Bug 1013831
Opened 11 years ago
Closed 10 years ago
Detect duplicated strings in .properties file and make Travis fail
Categories
(Firefox OS Graveyard :: Gaia::L10n, defect, P3)
Firefox OS Graveyard
Gaia::L10n
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: flod, Assigned: stas)
References
Details
Attachments
(1 file)
Discussed about this on IRC with :stas
Target is to avoid bugs like bug 1009351, where a duplicated string ID is added to the .properties file: this makes tools unhappy, and let us display the override value.
It should possible to do this in l10n.js
Reporter | ||
Comment 1•11 years ago
|
||
(In reply to Francesco Lodolo [:flod] from comment #0)
> Target is to avoid bugs like bug 1009351
Bug 1013826 is about removing the string, that is the implementation bug which is going to actually use the string.
Assignee | ||
Comment 2•11 years ago
|
||
This turns out to be slightly more involved:
- We don't want to have this logic in the parser, because a) it doesn't belong there, b) parsing is designed to be merciful: errors are emitted, not thrown, and parsing continues uninterrupted. I'd prefer to have this logic in Locale.addAST.
- Currently, however, the parser produces an AST which already is a dict, so any duplicate strings are overwritten during the parsing stage. It would generally be good for the AST to be a list, and I filed bug 1020231 for this.
- If we throw an error in Locale.addAST, the context will never become ready. I think the build will actually complete fine, but the app will be broken. As in, all integration tests are likely to fail. This might be a bit drastic :)
Depends on: 1020231
Updated•10 years ago
|
Priority: -- → P3
Reporter | ||
Comment 3•10 years ago
|
||
We were hit again in bug 951538. Any progress on this?
Assignee | ||
Comment 4•10 years ago
|
||
We're going to factorize the parser in bug 1022859. Next, I'll work on bug 1020231 which should make it possible to move forward with this bug. I'll have another update next week.
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → stas
Assignee | ||
Comment 5•10 years ago
|
||
Assignee | ||
Comment 6•10 years ago
|
||
I think I got this to work. I'll now need to remove the duplicates which break the build :)
Most of them is easy as they redefine strings from shared/locales/date and shared/locales/download.
Communications is a bit harder since the strings in Dialer are used in Contacts and the other way around. I think I'll file a separate bug for this.
/build_stage/emergency-call/index.html: L10nError: Duplicate string "cancel" found in app://emergency-call.gaiamobile.org
/build_stage/sms/index.html: L10nError: Duplicate string "incorrectDate" found in app://sms.gaiamobile.org
/build_stage/system/index.html: L10nError: Duplicate string "byteUnit-B" found in app://system.gaiamobile.org
/build_stage/system/index.html: L10nError: Duplicate string "byteUnit-KB" found in app://system.gaiamobile.org
/build_stage/system/index.html: L10nError: Duplicate string "byteUnit-MB" found in app://system.gaiamobile.org
/build_stage/system/index.html: L10nError: Duplicate string "byteUnit-GB" found in app://system.gaiamobile.org
/build_stage/system/index.html: L10nError: Duplicate string "byteUnit-TB" found in app://system.gaiamobile.org
/build_stage/system/index.html: L10nError: Duplicate string "fileSize" found in app://system.gaiamobile.org
/build_stage/communications/dialer/index.html: L10nError: Duplicate string "call" found in app://communications.gaiamobile.org
/build_stage/communications/dialer/index.html: L10nError: Duplicate string "edit" found in app://communications.gaiamobile.org
/build_stage/communications/dialer/index.html: L10nError: Duplicate string "cancel" found in app://communications.gaiamobile.org
/build_stage/communications/dialer/index.html: L10nError: Duplicate string "contacts" found in app://communications.gaiamobile.org
/build_stage/communications/dialer/index.html: L10nError: Duplicate string "selectAll" found in app://communications.gaiamobile.org
/build_stage/communications/dialer/index.html: L10nError: Duplicate string "deselectAll" found in app://communications.gaiamobile.org
/build_stage/communications/dialer/index.html: L10nError: Duplicate string "delete" found in app://communications.gaiamobile.org
/build_stage/communications/dialer/index.html: L10nError: Duplicate string "makeCall" found in app://communications.gaiamobile.org
/build_stage/communications/dialer/index.html: L10nError: Duplicate string "today" found in app://communications.gaiamobile.org
/build_stage/communications/dialer/index.html: L10nError: Duplicate string "yesterday" found in app://communications.gaiamobile.org
/build_stage/communications/dialer/index.html: L10nError: Duplicate string "cancel" found in app://communications.gaiamobile.org
/build_stage/settings/index.html: L10nError: Duplicate string "byteUnit-B" found in app://settings.gaiamobile.org
/build_stage/settings/index.html: L10nError: Duplicate string "byteUnit-KB" found in app://settings.gaiamobile.org
/build_stage/settings/index.html: L10nError: Duplicate string "byteUnit-MB" found in app://settings.gaiamobile.org
/build_stage/settings/index.html: L10nError: Duplicate string "byteUnit-GB" found in app://settings.gaiamobile.org
/build_stage/settings/index.html: L10nError: Duplicate string "byteUnit-TB" found in app://settings.gaiamobile.org
Assignee | ||
Comment 7•10 years ago
|
||
I filed bug 1098673 for Communications and fixed other apps on my branch.
Assignee | ||
Comment 8•10 years ago
|
||
flod, can you take a look at the changes in shared/locales/download and let me know if it's okay to just move these strings there from System and Settings?
Before a proper review request, I want to add build integration tests. I'll combine this with my work in bug 928740 and try to have it done by the end of next week.
Attachment #8522631 -
Flags: feedback?(francesco.lodolo)
Reporter | ||
Comment 9•10 years ago
|
||
Comment on attachment 8522631 [details] [review]
Throw on duplicate strings
Moved strings look definitely good to me, especially B instead of Bytes.
We should probably drop the comment about fileSize*
Attachment #8522631 -
Flags: feedback?(francesco.lodolo) → feedback+
Assignee | ||
Comment 10•10 years ago
|
||
Flod, do I need to change the id of the byteUnit-B string? :/
Reporter | ||
Comment 11•10 years ago
|
||
Absolutely no. It's in a different file, so it will be re-translated anyway.
Assignee | ||
Comment 12•10 years ago
|
||
Comment on attachment 8522631 [details] [review]
Throw on duplicate strings
https://treeherder.mozilla.org/#/jobs?repo=gaia-try&revision=a3b0de18f1e4
Attachment #8522631 -
Flags: review?(gandalf)
Comment 13•10 years ago
|
||
Comment on attachment 8522631 [details] [review]
Throw on duplicate strings
I'm a little worried about the scope of changes you introduce here, but since it's early in the cycle and I like all of them, r+ :)
I left some notes about eventlisteners that seem abundant.
Attachment #8522631 -
Flags: review?(gandalf) → review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Updated•10 years ago
|
Keywords: checkin-needed
Comment 14•10 years ago
|
||
https://github.com/mozilla-b2g/gaia/pull/25451
The pull request could not be applied to the integration branch. Please try again after current integration is complete. You may need to rebase your branch against the target branch.
Assignee | ||
Comment 15•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 16•10 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•