mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-15 09:58:57 -07:00
chore(gui): update HumanDuration.js (#9710)
Relevant changes: ko: Use correct names for month and hour in Korean (465eaed) Hide unit count if 2 in Arabic (f90d847)
This commit is contained in:
parent
a156e88eef
commit
1704827d04
@ -41,6 +41,7 @@
|
||||
* @prop {string} [delimiter]
|
||||
* @prop {DigitReplacements} [_digitReplacements]
|
||||
* @prop {boolean} [_numberFirst]
|
||||
* @prop {boolean} [_hideCountIf2]
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -116,6 +117,7 @@
|
||||
// minute -> د stands for "دقيقة"
|
||||
// second -> ث stands for "ثانية"
|
||||
ar: assign(language("س", "ش", "أ", "ي", "س", "د", "ث", "م ث", ","), {
|
||||
_hideCountIf2: true,
|
||||
_digitReplacements: ["۰", "١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩"]
|
||||
}),
|
||||
// български (Bulgarian)
|
||||
@ -177,7 +179,7 @@
|
||||
// ಕನ್ನಡ (Kannada)
|
||||
kn: language("ವ", "ತ", "ವ", "ದ", "ಗಂ", "ನಿ", "ಸೆ", "ಮಿಸೆ"),
|
||||
// 한국어 (Korean)
|
||||
ko: language("년", "월", "주", "일", "시", "분", "초", "밀리초"),
|
||||
ko: language("년", "달", "주", "일", "시간", "분", "초", "밀리초"),
|
||||
// Kurdî (Kurdish)
|
||||
ku: language("sal", "m", "h", "r", "s", "d", "ç", "ms", ","),
|
||||
// ລາວ (Lao)
|
||||
@ -464,19 +466,25 @@
|
||||
: Math.floor(unitCount * Math.pow(10, maxDecimalPoints)) /
|
||||
Math.pow(10, maxDecimalPoints);
|
||||
var countStr = normalizedUnitCount.toString();
|
||||
if (digitReplacements) {
|
||||
|
||||
if (language._hideCountIf2 && unitCount === 2) {
|
||||
formattedCount = "";
|
||||
for (var i = 0; i < countStr.length; i++) {
|
||||
var char = countStr[i];
|
||||
if (char === ".") {
|
||||
formattedCount += decimal;
|
||||
} else {
|
||||
// @ts-ignore because `char` should always be 0-9 at this point.
|
||||
formattedCount += digitReplacements[char];
|
||||
}
|
||||
}
|
||||
spacer = "";
|
||||
} else {
|
||||
formattedCount = countStr.replace(".", decimal);
|
||||
if (digitReplacements) {
|
||||
formattedCount = "";
|
||||
for (var i = 0; i < countStr.length; i++) {
|
||||
var char = countStr[i];
|
||||
if (char === ".") {
|
||||
formattedCount += decimal;
|
||||
} else {
|
||||
// @ts-ignore because `char` should always be 0-9 at this point.
|
||||
formattedCount += digitReplacements[char];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
formattedCount = countStr.replace(".", decimal);
|
||||
}
|
||||
}
|
||||
|
||||
var languageWord = language[unitName];
|
||||
|
Loading…
Reference in New Issue
Block a user