mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-09-27 00:56:40 +00:00
i18n: translate VM and LXC status and schedule states
This commit is contained in:
@@ -132,4 +132,18 @@ export function useT() {
|
||||
return useI18n().t
|
||||
}
|
||||
|
||||
export function getCountFormKey(language: LanguageCode, key: string, count: number): string {
|
||||
if (language !== "sk") return key
|
||||
|
||||
const absoluteCount = Math.abs(count)
|
||||
const lastDigit = absoluteCount % 10
|
||||
const lastTwoDigits = absoluteCount % 100
|
||||
|
||||
if (lastDigit === 1 && lastTwoDigits !== 11) return `${key}One`
|
||||
if (lastDigit >= 2 && lastDigit <= 4 && !(lastTwoDigits >= 12 && lastTwoDigits <= 14)) {
|
||||
return `${key}Few`
|
||||
}
|
||||
return `${key}Many`
|
||||
}
|
||||
|
||||
export { SUPPORTED_LANGUAGES }
|
||||
|
||||
Reference in New Issue
Block a user