mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1172768 - Loop's desktop plural form handling doesn't handle zeros very well. r=mikedeboer
This commit is contained in:
parent
73392f2f41
commit
40995be175
@ -38,8 +38,9 @@
|
||||
|
||||
// translate a string
|
||||
function translateString(key, args, fallback) {
|
||||
if (args && args.num) {
|
||||
var num = args && args.num;
|
||||
var num;
|
||||
if (args && ("num" in args)) {
|
||||
num = args.num;
|
||||
}
|
||||
var data = getL10nData(key, num);
|
||||
if (!data && fallback)
|
||||
|
@ -34,4 +34,8 @@ describe("document.mozL10n", function() {
|
||||
it("should get a plural form", function() {
|
||||
expect(document.mozL10n.get("plural", {num: 10})).eql("10 plural forms");
|
||||
});
|
||||
|
||||
it("should correctly get a plural form for num = 0", function() {
|
||||
expect(document.mozL10n.get("plural", {num: 0})).eql("0 plural form");
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user