mirror of
https://gh.llkk.cc/https://github.com/WeblateOrg/language-data.git
synced 2025-10-03 15:01:09 +08:00
fix: remove duplicate plural definitions for Qt
The source file contains ambiguous definition for Filipino and double definition for Interlingua.
This commit is contained in:
parent
9707e582dd
commit
5994f50d4e
4 changed files with 9 additions and 21 deletions
2
qt.csv
2
qt.csv
|
@ -31,7 +31,6 @@ et,Estonian,2,(n != 1)
|
|||
eu,Basque,2,(n != 1)
|
||||
fa,Persian,1,0
|
||||
fi,Finnish,2,(n != 1)
|
||||
fil,Filipino,2,(n > 1)
|
||||
fil,Filipino,3,(n==1 ? 0 : (n%10==4 || n%10==6 || n%10== 9) ? 1 : 2)
|
||||
fj,Fijian,1,0
|
||||
fo,Faroese,2,(n != 1)
|
||||
|
@ -51,7 +50,6 @@ hr,Croatian,3,(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%1
|
|||
hu,Hungarian,1,0
|
||||
hy,Armenian,2,(n > 1)
|
||||
ia,Interlingua,2,(n != 1)
|
||||
ia,Interlingua,2,(n != 1)
|
||||
id,Indonesian,1,0
|
||||
ik,Inupiaq,3,(n==1 ? 0 : n==2 ? 1 : 2)
|
||||
is,Icelandic,2,(n%10==1 && n%100!=11 ? 0 : 1)
|
||||
|
|
|
|
@ -11,7 +11,7 @@ import csv
|
|||
ALIASES = {
|
||||
"Chinese": ("Chinese (Simplified Han script)", "Chinese (Traditional Han script)"),
|
||||
"WesternFrisian": ("Frisian",),
|
||||
"Interlingue": ("Interlingua",),
|
||||
"Interlingue": (), # Ignore, duplicate for Interlingua
|
||||
"Khmer": ("Khmer (Central)",),
|
||||
"Kirghiz": ("Kyrgyz",),
|
||||
"NorthernSotho": ("Pedi",),
|
||||
|
@ -56,6 +56,9 @@ PLURALS = {}
|
|||
def handle_language(parts):
|
||||
text = "".join(parts).replace("\n", "")[31:]
|
||||
name = text.split("[", 1)[0]
|
||||
# Remove duplicate definition
|
||||
if name == "frenchStyleLanguages":
|
||||
text = text.replace("QLocale::Filipino,", "")
|
||||
# Hack to deal with frenchStyleCountries
|
||||
if name == "frenchStyleLanguages":
|
||||
text = text.replace("Portuguese", "PortugueseBrasil")
|
||||
|
@ -103,11 +106,14 @@ with open("modules/qttools/src/linguist/shared/numerus.cpp") as handle:
|
|||
in_table = True
|
||||
|
||||
output = []
|
||||
processed = set()
|
||||
|
||||
|
||||
def generate(group, name):
|
||||
definition = DEFINITIONS[name]
|
||||
plural = PLURALS[group]
|
||||
if definition[0] in processed:
|
||||
raise ValueError(f"Duplicate definition for {definition[0]}")
|
||||
output.append(
|
||||
(
|
||||
definition[0],
|
||||
|
@ -116,6 +122,7 @@ def generate(group, name):
|
|||
plural[1],
|
||||
)
|
||||
)
|
||||
processed.add(definition[0])
|
||||
|
||||
|
||||
for group, languages in LANGUAGES.items():
|
||||
|
|
|
@ -24,6 +24,7 @@ def parse_csv(name):
|
|||
languages = parse_csv("languages.csv")
|
||||
aliases = parse_csv("aliases.csv")
|
||||
cldr = parse_csv("cldr.csv")
|
||||
parse_csv("qt.csv")
|
||||
default_countries = parse_csv("default_countries.csv")
|
||||
|
||||
for alias in aliases:
|
||||
|
|
|
@ -616,15 +616,6 @@ QTPLURALS = (
|
|||
2,
|
||||
"(n != 1)",
|
||||
),
|
||||
(
|
||||
"fil",
|
||||
# Translators: Language name for ISO code "fil". The parenthesis clarifies
|
||||
# variant of the language. It could contain a region, age (Old, Middle, ...)
|
||||
# or other variant.
|
||||
_("Filipino"),
|
||||
2,
|
||||
"(n > 1)",
|
||||
),
|
||||
(
|
||||
"fil",
|
||||
# Translators: Language name for ISO code "fil". The parenthesis clarifies
|
||||
|
@ -796,15 +787,6 @@ QTPLURALS = (
|
|||
2,
|
||||
"(n != 1)",
|
||||
),
|
||||
(
|
||||
"ia",
|
||||
# Translators: Language name for ISO code "ia". The parenthesis clarifies
|
||||
# variant of the language. It could contain a region, age (Old, Middle, ...)
|
||||
# or other variant.
|
||||
_("Interlingua"),
|
||||
2,
|
||||
"(n != 1)",
|
||||
),
|
||||
(
|
||||
"id",
|
||||
# Translators: Language name for ISO code "id". The parenthesis clarifies
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue