diff --git a/schema.json b/schema.json index 50372ec7..c56dc17d 100644 --- a/schema.json +++ b/schema.json @@ -31,10 +31,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "أشهر", "description": "Translation of \"months\" (plural). The default value is `أشهر`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "سنة", @@ -43,10 +53,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "سنوات", "description": "Translation of \"years\" (plural). The default value is `سنوات`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "الحاضر", @@ -472,10 +492,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "måneder", "description": "Translation of \"months\" (plural). The default value is `måneder`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "år", @@ -484,10 +514,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "år", "description": "Translation of \"years\" (plural). The default value is `år`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "nuværende", @@ -570,10 +610,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "maanden", "description": "Translation of \"months\" (plural). The default value is `maanden`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "jaar", @@ -582,10 +632,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "jaren", "description": "Translation of \"years\" (plural). The default value is `jaren`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "heden", @@ -788,10 +848,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "months", "description": "Translation of \"months\" (plural). The default value is `months`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "year", @@ -800,10 +870,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "years", "description": "Translation of \"years\" (plural). The default value is `years`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "present", @@ -904,10 +984,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "mois", "description": "Translation of \"months\" (plural). The default value is `mois`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "an", @@ -916,10 +1006,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "ans", "description": "Translation of \"years\" (plural). The default value is `ans`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "présent", @@ -1002,10 +1102,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "Monate", "description": "Translation of \"months\" (plural). The default value is `Monate`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "Jahr", @@ -1014,10 +1124,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "Jahre", "description": "Translation of \"years\" (plural). The default value is `Jahre`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "gegenwärtig", @@ -1140,10 +1260,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "חודשים", "description": "Translation of \"months\" (plural). The default value is `חודשים`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "שנה", @@ -1152,10 +1282,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "שנים", "description": "Translation of \"years\" (plural). The default value is `שנים`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "הווה", @@ -1238,10 +1378,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "महीने", "description": "Translation of \"months\" (plural). The default value is `महीने`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "वर्ष", @@ -1250,10 +1400,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "वर्ष", "description": "Translation of \"years\" (plural). The default value is `वर्ष`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "वर्तमान", @@ -1336,10 +1496,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "bulan", "description": "Translation of \"months\" (plural). The default value is `bulan`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "tahun", @@ -1348,10 +1518,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "tahun", "description": "Translation of \"years\" (plural). The default value is `tahun`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "sekarang", @@ -1474,10 +1654,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "mesi", "description": "Translation of \"months\" (plural). The default value is `mesi`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "anno", @@ -1486,10 +1676,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "anni", "description": "Translation of \"years\" (plural). The default value is `anni`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "presente", @@ -1572,10 +1772,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "ヶ月", "description": "Translation of \"months\" (plural). The default value is `ヶ月`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "年", @@ -1584,10 +1794,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "年", "description": "Translation of \"years\" (plural). The default value is `年`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "現在", @@ -1670,10 +1890,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "개월", "description": "Translation of \"months\" (plural). The default value is `개월`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "년", @@ -1682,10 +1912,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "년", "description": "Translation of \"years\" (plural). The default value is `년`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "현재", @@ -1822,6 +2062,7 @@ "norwegian_bokmål": "#/$defs/NorwegianBokm_lLocale", "norwegian_nynorsk": "#/$defs/NorwegianNynorskLocale", "persian": "#/$defs/PersianLocale", + "polish": "#/$defs/PolishLocale", "portuguese": "#/$defs/PortugueseLocale", "russian": "#/$defs/RussianLocale", "spanish": "#/$defs/SpanishLocale", @@ -1878,6 +2119,9 @@ { "$ref": "#/$defs/PersianLocale" }, + { + "$ref": "#/$defs/PolishLocale" + }, { "$ref": "#/$defs/PortugueseLocale" }, @@ -1915,10 +2159,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "个月", "description": "Translation of \"months\" (plural). The default value is `个月`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "年", @@ -1927,10 +2181,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "年", "description": "Translation of \"years\" (plural). The default value is `年`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "至今", @@ -2053,10 +2317,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "måneder", "description": "Translation of \"months\" (plural). The default value is `måneder`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "år", @@ -2065,10 +2339,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "år", "description": "Translation of \"years\" (plural). The default value is `år`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "nåværende", @@ -2151,10 +2435,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "månader", "description": "Translation of \"months\" (plural). The default value is `månader`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "år", @@ -2163,10 +2457,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "år", "description": "Translation of \"years\" (plural). The default value is `år`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "nåverande", @@ -2317,10 +2621,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "ماه", "description": "Translation of \"months\" (plural). The default value is `ماه`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "سال", @@ -2329,10 +2643,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "سال", "description": "Translation of \"years\" (plural). The default value is `سال`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "حال", @@ -2404,6 +2728,132 @@ "format": "path", "type": "string" }, + "PolishLocale": { + "additionalProperties": false, + "properties": { + "language": { + "const": "polish", + "default": "polish", + "description": "The language for your CV. The default value is `polish`.", + "title": "Language", + "type": "string" + }, + "last_updated": { + "default": "Ostatnia aktualizacja", + "description": "Translation of \"Last updated in\". The default value is `Ostatnia aktualizacja`.", + "title": "Last Updated", + "type": "string" + }, + "month": { + "default": "miesiąc", + "description": "Translation of \"month\" (singular). The default value is `miesiąc`.", + "title": "Month", + "type": "string" + }, + "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], + "default": { + "one": "miesiąc", + "few": "miesiące", + "many": "miesięcy" + }, + "description": "Translation of \"months\" (plural). The default value is `months`.", + "title": "Months" + }, + "year": { + "default": "rok", + "description": "Translation of \"year\" (singular). The default value is `rok`.", + "title": "Year", + "type": "string" + }, + "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], + "default": { + "one": "rok", + "few": "lata", + "many": "lat" + }, + "description": "Translation of \"years\" (plural). The default value is `years`.", + "title": "Years" + }, + "present": { + "default": "obecnie", + "description": "Translation of \"present\" for ongoing dates. The default value is `obecnie`.", + "title": "Present", + "type": "string" + }, + "phrases": { + "$ref": "#/$defs/rendercv__schema__models__locale__english_locale__Phrases__1", + "description": "Locale-specific phrases used in entry templates as placeholders." + }, + "month_abbreviations": { + "default": [ + "Sty", + "Lut", + "Mar", + "Kwi", + "Maj", + "Cze", + "Lip", + "Sie", + "Wrz", + "Paź", + "Lis", + "Gru" + ], + "description": "Month abbreviations (Jan-Dec).", + "items": { + "type": "string" + }, + "title": "Month Abbreviations", + "type": "array" + }, + "month_names": { + "default": [ + "Styczeń", + "Luty", + "Marzec", + "Kwiecień", + "Maj", + "Czerwiec", + "Lipiec", + "Sierpień", + "Wrzesień", + "Październik", + "Listopad", + "Grudzień" + ], + "description": "Full month names (January-December).", + "items": { + "type": "string" + }, + "title": "Month Names", + "type": "array" + } + }, + "title": "PolishLocale", + "type": "object" + }, "PortugueseLocale": { "additionalProperties": false, "properties": { @@ -2427,10 +2877,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "meses", "description": "Translation of \"months\" (plural). The default value is `meses`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "ano", @@ -2439,10 +2899,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "anos", "description": "Translation of \"years\" (plural). The default value is `anos`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "presente", @@ -2637,10 +3107,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "месяцы", "description": "Translation of \"months\" (plural). The default value is `месяцы`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "год", @@ -2649,10 +3129,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "лет", "description": "Translation of \"years\" (plural). The default value is `лет`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "настоящее время", @@ -2878,10 +3368,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "meses", "description": "Translation of \"months\" (plural). The default value is `meses`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "año", @@ -2890,10 +3390,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "años", "description": "Translation of \"years\" (plural). The default value is `años`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "presente", @@ -2976,10 +3486,20 @@ "type": "string" }, "months": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "ay", "description": "Translation of \"months\" (plural). The default value is `ay`.", - "title": "Months", - "type": "string" + "title": "Months" }, "year": { "default": "yıl", @@ -2988,10 +3508,20 @@ "type": "string" }, "years": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], "default": "yıl", "description": "Translation of \"years\" (plural). The default value is `yıl`.", - "title": "Years", - "type": "string" + "title": "Years" }, "present": { "default": "halen", diff --git a/src/rendercv/renderer/templater/date.py b/src/rendercv/renderer/templater/date.py index 7010b050..5c9f0af3 100644 --- a/src/rendercv/renderer/templater/date.py +++ b/src/rendercv/renderer/templater/date.py @@ -6,6 +6,7 @@ from rendercv.schema.models.cv.entries.bases.entry_with_complex_fields import ( ) from rendercv.schema.models.locale.locale import Locale +from .plural_rules import get_plural_rules from .string_processor import substitute_placeholders @@ -228,6 +229,50 @@ def compute_time_span_string( Returns: Formatted time span string with years and months. """ + + def _get_localized_label( + count: int, + singular_label: str, + plural_data: str | dict[str, str], + lang_iso: str, + ) -> str: + """Select the correct localized label based on count and language plural rules. + + Why: + This helper function returns the appropriate singular, plural, or language-specific + plural form of a label based on the count value and the target language's pluralization rules. + + Args: + count: The quantity used to determine which plural form to use. + singular_label: The label to return when count equals 1. + plural_data: Either a string (for simple plural forms) or a dictionary mapping + plural categories ('one', 'few', 'many', etc.) to their localized labels. + lang_iso: ISO 639-1 language code (e.g., 'en', 'de', 'ru') used to determine + plural rules and categories. + + Returns: + The appropriate localized label (string) for the given count and language. + Returns an empty string if count is 0. + Returns singular_label if count is 1. + Returns the language-specific plural form from plural_data if count > 1. + """ + if count == 0: + return "" + + if count == 1: + return singular_label + + if isinstance(plural_data, dict): + # Determine the category tag (one, few, many) + category = get_plural_rules(count, lang_iso) + # Return the specific form, or 'many' as a fallback + return plural_data.get(category, plural_data.get("many", "")) + + # Fallback for standard string-based locales (english, german, etc.) + return plural_data + + lang_iso = locale.language_iso_639_1 + if isinstance(start_date, int) or isinstance(end_date, int): # Then it means one of the dates is year, so time span cannot be more # specific than years. @@ -236,15 +281,12 @@ def compute_time_span_string( time_span_in_years = end_year - start_year - if time_span_in_years < 2: - how_many_years = "1" - locale_years = locale.year - else: - how_many_years = str(time_span_in_years) - locale_years = locale.years + locale_years = _get_localized_label( + time_span_in_years, locale.year, locale.years, lang_iso + ) placeholders: dict[str, str] = { - "HOW_MANY_YEARS": how_many_years, + "HOW_MANY_YEARS": str(time_span_in_years), "YEARS": locale_years, "HOW_MANY_MONTHS": "", "MONTHS": "", @@ -268,31 +310,23 @@ def compute_time_span_string( how_many_months %= 12 # Format the number of years and months between start_date and end_date: - if how_many_years == 0: + locale_years = _get_localized_label( + how_many_years, locale.year, locale.years, lang_iso + ) + if locale_years == "": how_many_years = "" - locale_years = "" - elif how_many_years == 1: - how_many_years = "1" - locale_years = locale.year - else: - how_many_years = str(how_many_years) - locale_years = locale.years # Format the number of months between start_date and end_date: - if how_many_months == 0: + locale_months = _get_localized_label( + how_many_months, locale.month, locale.months, lang_iso + ) + if locale_months == "": how_many_months = "" - locale_months = "" - elif how_many_months == 1: - how_many_months = "1" - locale_months = locale.month - else: - how_many_months = str(how_many_months) - locale_months = locale.months placeholders = { - "HOW_MANY_YEARS": how_many_years, + "HOW_MANY_YEARS": str(how_many_years), "YEARS": locale_years, - "HOW_MANY_MONTHS": how_many_months, + "HOW_MANY_MONTHS": str(how_many_months), "MONTHS": locale_months, } return substitute_placeholders(time_span_template, placeholders) diff --git a/src/rendercv/renderer/templater/plural_rules.py b/src/rendercv/renderer/templater/plural_rules.py new file mode 100644 index 00000000..c82382c0 --- /dev/null +++ b/src/rendercv/renderer/templater/plural_rules.py @@ -0,0 +1,57 @@ +# https://www.unicode.org/cldr/charts/48/supplemental/language_plural_rules.html + + +def polish_rule(count: int) -> str: + if count == 1: + return "one" + if 2 <= count % 10 <= 4 and not (12 <= count % 100 <= 14): + return "few" + return "many" + + +# Registry mapping ISO codes to rule functions +PLURAL_RULES = { + "pl": polish_rule, + # add here new set of rules +} + + +def default_rule(n: int) -> str: + """Fallback rule for simple singular/plural languages.""" + return "one" if n == 1 else "other" + + +def get_plural_rules(count: int, language_code: str): + """Determine the appropriate CLDR (Unicode Common Locale Data Repository) plural category + for a given count and language code. + + Why: + This function returns the grammatical plural category that should be used for a specific number in a given language. Different languages have different plural rules - for example, English has two forms (singular/plural), while Polish has three, and Arabic has six. + + Example: + ```py + >>> get_plural_rules(1, "en") + 'one' + >>> get_plural_rules(5, "en") + 'other' + ``` + + Args: + count (int): The number for which to determine the plural category. + language_code (str): The ISO language code (e.g., 'en', 'pl', 'ar') identifying + which language's plural rules to apply. + + Returns: + str: The CLDR plural category, typically one of: 'zero', 'one', 'two', 'few', 'many', or 'other'. + The exact categories available depend on the language's plural rules. + + Note: + - This function relies on a PLURAL_RULES dictionary that maps language codes to their + respective plural rule functions. + - If the language_code is not found in PLURAL_RULES, a default_rule function is used + as a fallback. + - CLDR plural categories are used for proper localization and internationalization (i18n) of text that contains numbers. + + """ + rule = PLURAL_RULES.get(language_code, default_rule) + return rule(count) diff --git a/src/rendercv/schema/models/locale/english_locale.py b/src/rendercv/schema/models/locale/english_locale.py index 87052cec..f09bea05 100644 --- a/src/rendercv/schema/models/locale/english_locale.py +++ b/src/rendercv/schema/models/locale/english_locale.py @@ -33,7 +33,7 @@ class EnglishLocale(BaseModelWithoutExtraKeys): default="month", description='Translation of "month" (singular). The default value is `month`.', ) - months: str = pydantic.Field( + months: str | dict[str, str] = pydantic.Field( default="months", description='Translation of "months" (plural). The default value is `months`.', ) @@ -41,7 +41,7 @@ class EnglishLocale(BaseModelWithoutExtraKeys): default="year", description='Translation of "year" (singular). The default value is `year`.', ) - years: str = pydantic.Field( + years: str | dict[str, str] = pydantic.Field( default="years", description='Translation of "years" (plural). The default value is `years`.', ) @@ -131,6 +131,7 @@ class EnglishLocale(BaseModelWithoutExtraKeys): "arabic": "ar", "hebrew": "he", "persian": "fa", + "polish": "pl", }[self.language] @functools.cached_property diff --git a/src/rendercv/schema/models/locale/other_locales/polish.yaml b/src/rendercv/schema/models/locale/other_locales/polish.yaml new file mode 100644 index 00000000..36b928cf --- /dev/null +++ b/src/rendercv/schema/models/locale/other_locales/polish.yaml @@ -0,0 +1,41 @@ +# yaml-language-server: $schema=../../../../../../schema.json +locale: + language: polish + last_updated: "Ostatnia aktualizacja" + month: "miesiąc" + months: + one: "miesiąc" + few: "miesiące" + many: "miesięcy" + year: "rok" + years: + one: "rok" + few: "lata" + many: "lat" + present: "obecnie" + month_abbreviations: + - Sty + - Lut + - Mar + - Kwi + - Maj + - Cze + - Lip + - Sie + - Wrz + - Paź + - Lis + - Gru + month_names: + - Styczeń + - Luty + - Marzec + - Kwiecień + - Maj + - Czerwiec + - Lipiec + - Sierpień + - Wrzesień + - Październik + - Listopad + - Grudzień