feat(locale): add Danish locale (#556)

* Fix smokeshow for PRs

* feat(locale): add Danish locale

Add Danish locale file with translations for month names, abbreviations,
and other locale-specific strings. Danish language code 'da' is supported
as a valid ISO 639-1 code through the LanguageAlpha2 type.

The locale file can be used with the --locale-catalog option or included
inline in CV YAML files.

* fix: moved danish locale to correct location

* Fix minor issues

* Fix Indonesian

---------

Co-authored-by: Sina Atalay <79940989+sinaatalay@users.noreply.github.com>
Co-authored-by: Jakob Guldberg Aaes <jakob1379@gmali.com>
This commit is contained in:
Jakob Stender Gulberg
2025-12-23 13:14:42 +01:00
committed by GitHub
parent 83114b0b54
commit 3360db357a
4 changed files with 149 additions and 15 deletions

View File

@@ -327,6 +327,100 @@
"title": "Cv", "title": "Cv",
"type": "object" "type": "object"
}, },
"DanishLocale": {
"additionalProperties": false,
"properties": {
"language": {
"const": "danish",
"default": "danish",
"description": "The language for your CV. The default value is `danish`.",
"title": "Language",
"type": "string"
},
"last_updated": {
"default": "Senest opdateret",
"description": "Translation of \"Last updated in\". The default value is `Senest opdateret`.",
"title": "Last Updated",
"type": "string"
},
"month": {
"default": "måned",
"description": "Translation of \"month\" (singular). The default value is `måned`.",
"title": "Month",
"type": "string"
},
"months": {
"default": "måneder",
"description": "Translation of \"months\" (plural). The default value is `måneder`.",
"title": "Months",
"type": "string"
},
"year": {
"default": "år",
"description": "Translation of \"year\" (singular). The default value is `år`.",
"title": "Year",
"type": "string"
},
"years": {
"default": "år",
"description": "Translation of \"years\" (plural). The default value is `år`.",
"title": "Years",
"type": "string"
},
"present": {
"default": "nuværende",
"description": "Translation of \"present\" for ongoing dates. The default value is `nuværende`.",
"title": "Present",
"type": "string"
},
"month_abbreviations": {
"default": [
"Jan",
"Feb",
"Mar",
"Apr",
"Maj",
"Jun",
"Jul",
"Aug",
"Sep",
"Okt",
"Nov",
"Dec"
],
"description": "Month abbreviations (Jan-Dec).",
"items": {
"type": "string"
},
"title": "Month Abbreviations",
"type": "array"
},
"month_names": {
"default": [
"Januar",
"Februar",
"Marts",
"April",
"Maj",
"Juni",
"Juli",
"August",
"September",
"Oktober",
"November",
"December"
],
"description": "Full month names (January-December).",
"items": {
"type": "string"
},
"title": "Month Names",
"type": "array"
}
},
"title": "DanishLocale",
"type": "object"
},
"EngineeringclassicTheme": { "EngineeringclassicTheme": {
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
@@ -801,13 +895,13 @@
"title": "HindiLocale", "title": "HindiLocale",
"type": "object" "type": "object"
}, },
"IndonesiaLocale": { "IndonesianLocale": {
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"language": { "language": {
"const": "indonesia", "const": "indonesian",
"default": "indonesia", "default": "indonesian",
"description": "The language for your CV. The default value is `indonesia`.", "description": "The language for your CV. The default value is `indonesian`.",
"title": "Language", "title": "Language",
"type": "string" "type": "string"
}, },
@@ -892,7 +986,7 @@
"type": "array" "type": "array"
} }
}, },
"title": "IndonesiaLocale", "title": "IndonesianLocale",
"type": "object" "type": "object"
}, },
"ItalianLocale": { "ItalianLocale": {
@@ -1238,11 +1332,12 @@
"Locale": { "Locale": {
"discriminator": { "discriminator": {
"mapping": { "mapping": {
"danish": "#/$defs/DanishLocale",
"english": "#/$defs/EnglishLocale", "english": "#/$defs/EnglishLocale",
"french": "#/$defs/FrenchLocale", "french": "#/$defs/FrenchLocale",
"german": "#/$defs/GermanLocale", "german": "#/$defs/GermanLocale",
"hindi": "#/$defs/HindiLocale", "hindi": "#/$defs/HindiLocale",
"indonesia": "#/$defs/IndonesiaLocale", "indonesian": "#/$defs/IndonesianLocale",
"italian": "#/$defs/ItalianLocale", "italian": "#/$defs/ItalianLocale",
"japanese": "#/$defs/JapaneseLocale", "japanese": "#/$defs/JapaneseLocale",
"korean": "#/$defs/KoreanLocale", "korean": "#/$defs/KoreanLocale",
@@ -1258,6 +1353,9 @@
{ {
"$ref": "#/$defs/EnglishLocale" "$ref": "#/$defs/EnglishLocale"
}, },
{
"$ref": "#/$defs/DanishLocale"
},
{ {
"$ref": "#/$defs/FrenchLocale" "$ref": "#/$defs/FrenchLocale"
}, },
@@ -1268,7 +1366,7 @@
"$ref": "#/$defs/HindiLocale" "$ref": "#/$defs/HindiLocale"
}, },
{ {
"$ref": "#/$defs/IndonesiaLocale" "$ref": "#/$defs/IndonesianLocale"
}, },
{ {
"$ref": "#/$defs/ItalianLocale" "$ref": "#/$defs/ItalianLocale"

View File

@@ -95,17 +95,19 @@ class EnglishLocale(BaseModelWithoutExtraKeys):
Two-letter ISO 639-1 language code for Typst and HTML. Two-letter ISO 639-1 language code for Typst and HTML.
""" """
return { return {
"danish": "da",
"english": "en", "english": "en",
"mandarin_chineese": "zh",
"hindi": "hi",
"spanish": "es",
"french": "fr", "french": "fr",
"portuguese": "pt",
"german": "de", "german": "de",
"turkish": "tr", "hindi": "hi",
"italian": "it", "italian": "it",
"russian": "ru", "indonesian": "id",
"japanese": "ja", "japanese": "ja",
"korean": "ko", "korean": "ko",
"indonesia": "id", "indonesia": "id",
"mandarin_chineese": "zh",
"portuguese": "pt",
"russian": "ru",
"spanish": "es",
"turkish": "tr",
}[self.language] }[self.language]

View File

@@ -0,0 +1,35 @@
# yaml-language-server: $schema=../../../../../../schema.json
locale:
language: danish
last_updated: "Senest opdateret"
month: "måned"
months: "måneder"
year: "år"
years: "år"
present: "nuværende"
month_abbreviations:
- "Jan"
- "Feb"
- "Mar"
- "Apr"
- "Maj"
- "Jun"
- "Jul"
- "Aug"
- "Sep"
- "Okt"
- "Nov"
- "Dec"
month_names:
- "Januar"
- "Februar"
- "Marts"
- "April"
- "Maj"
- "Juni"
- "Juli"
- "August"
- "September"
- "Oktober"
- "November"
- "December"

View File

@@ -1,6 +1,6 @@
# yaml-language-server: $schema=../../../../../../schema.json # yaml-language-server: $schema=../../../../../../schema.json
locale: locale:
language: indonesia language: indonesian
last_updated: Terakhir diperbarui last_updated: Terakhir diperbarui
month: bulan month: bulan
months: bulan months: bulan
@@ -33,4 +33,3 @@ locale:
- Oktober - Oktober
- November - November
- Desember - Desember