From 0c364753cf86dee97446ce0d08b8f307f692e9ff Mon Sep 17 00:00:00 2001 From: vapormusic Date: Sat, 12 Feb 2022 10:23:25 +0700 Subject: [PATCH] update notice --- src/i18n/README.md | 20 ++++++++++++++++++++ src/i18n/en_US.jsonc | 1 + src/renderer/index.js | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/i18n/README.md b/src/i18n/README.md index 3fa8fffd..264ceea6 100644 --- a/src/i18n/README.md +++ b/src/i18n/README.md @@ -9,6 +9,26 @@ Some notes about Cider's i18n support. - Most of the strings in the content area are provided and translated by Apple themselves, and do not need to be translated. - The language Apple Music uses are dependent on the storefront region. +# Multiple Plural Forms + +Multiple plural forms can be supported as below: + +The keys and its meanings are here : https://github.com/prantlf/fast-plural-rules/blob/master/docs/languages.md#supported-languages + +For example , English is in Plural rule #1 and has 2 keys ```one``` and ```other``` + +Russian is in Plural rule #7 (3 forms) : ```one```, ```few``` and ```other``` + +How it is implemented for English: + +``` + "term.track": { + "one" : "track", + "other" : "tracks" + }, +``` + + ## Localization Notices diff --git a/src/i18n/en_US.jsonc b/src/i18n/en_US.jsonc index 07c72a2e..eb451e89 100644 --- a/src/i18n/en_US.jsonc +++ b/src/i18n/en_US.jsonc @@ -124,6 +124,7 @@ "term.contributors": "Contributors", "term.equalizer": "Equalizer", "term.reset": "Reset", + // Example for multiple plural forms : look up the key for your language in https://github.com/prantlf/fast-plural-rules/blob/master/docs/languages.md#supported-languages "term.track": { "one" : "track", "other" : "tracks" diff --git a/src/renderer/index.js b/src/renderer/index.js index db38d8f7..3877605a 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -331,7 +331,7 @@ const app = new Vue({ } else { // fallback English plural forms ( old i18n ) if (options["count"] > 1) { - return this.lz[message+ "s"] ?? this.lz[message]} else { return this.lz[message]} + return this.lz[message+ "s"] ?? this.lz[message]} else { return this.lz[message] ?? this.lz[message+ "s"]} } } else if(typeof this.lz[message] === "object") { return (this.lz[message])[Object.keys(this.lz[message])[0]]