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:
Ross Smith II 2024-09-15 01:21:18 -07:00 committed by GitHub
parent a156e88eef
commit 1704827d04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,6 +466,11 @@
: Math.floor(unitCount * Math.pow(10, maxDecimalPoints)) /
Math.pow(10, maxDecimalPoints);
var countStr = normalizedUnitCount.toString();
if (language._hideCountIf2 && unitCount === 2) {
formattedCount = "";
spacer = "";
} else {
if (digitReplacements) {
formattedCount = "";
for (var i = 0; i < countStr.length; i++) {
@ -478,6 +485,7 @@
} else {
formattedCount = countStr.replace(".", decimal);
}
}
var languageWord = language[unitName];
var word;