refactor(i18n): rename common.{verb,noun,article} to gram.*
Move grammar data (verbs, nouns, articles) from "common" to "gram" namespace - a tribute to Gram (grandmother) and short for grammar. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
94723454a8
commit
4a8db3bcbc
3 changed files with 33 additions and 30 deletions
|
|
@ -211,10 +211,11 @@ func flattenWithGrammar(prefix string, data map[string]any, out map[string]Messa
|
|||
|
||||
case map[string]any:
|
||||
// Check if this is a verb form object
|
||||
// Grammar data lives under "gram.*" (a nod to Gram - grandmother)
|
||||
if grammar != nil && isVerbFormObject(v) {
|
||||
verbName := key
|
||||
if strings.HasPrefix(fullKey, "common.verb.") {
|
||||
verbName = strings.TrimPrefix(fullKey, "common.verb.")
|
||||
if strings.HasPrefix(fullKey, "gram.verb.") {
|
||||
verbName = strings.TrimPrefix(fullKey, "gram.verb.")
|
||||
}
|
||||
forms := VerbForms{}
|
||||
if base, ok := v["base"].(string); ok {
|
||||
|
|
@ -233,8 +234,8 @@ func flattenWithGrammar(prefix string, data map[string]any, out map[string]Messa
|
|||
// Check if this is a noun form object
|
||||
if grammar != nil && isNounFormObject(v) {
|
||||
nounName := key
|
||||
if strings.HasPrefix(fullKey, "common.noun.") {
|
||||
nounName = strings.TrimPrefix(fullKey, "common.noun.")
|
||||
if strings.HasPrefix(fullKey, "gram.noun.") {
|
||||
nounName = strings.TrimPrefix(fullKey, "gram.noun.")
|
||||
}
|
||||
forms := NounForms{}
|
||||
if one, ok := v["one"].(string); ok {
|
||||
|
|
@ -251,7 +252,7 @@ func flattenWithGrammar(prefix string, data map[string]any, out map[string]Messa
|
|||
}
|
||||
|
||||
// Check if this is an article object
|
||||
if grammar != nil && fullKey == "common.article" {
|
||||
if grammar != nil && fullKey == "gram.article" {
|
||||
if indef, ok := v["indefinite"].(map[string]any); ok {
|
||||
if def, ok := indef["default"].(string); ok {
|
||||
grammar.Articles.IndefiniteDefault = def
|
||||
|
|
|
|||
|
|
@ -1,29 +1,29 @@
|
|||
{
|
||||
"common.verb.delete": { "base": "löschen", "past": "gelöscht", "gerund": "löschend" },
|
||||
"common.verb.save": { "base": "speichern", "past": "gespeichert", "gerund": "speichernd" },
|
||||
"common.verb.create": { "base": "erstellen", "past": "erstellt", "gerund": "erstellend" },
|
||||
"common.verb.update": { "base": "aktualisieren", "past": "aktualisiert", "gerund": "aktualisierend" },
|
||||
"common.verb.build": { "base": "bauen", "past": "gebaut", "gerund": "bauend" },
|
||||
"common.verb.run": { "base": "laufen", "past": "gelaufen", "gerund": "laufend" },
|
||||
"common.verb.check": { "base": "prüfen", "past": "geprüft", "gerund": "prüfend" },
|
||||
"common.verb.install": { "base": "installieren", "past": "installiert", "gerund": "installierend" },
|
||||
"common.verb.push": { "base": "pushen", "past": "gepusht", "gerund": "pushend" },
|
||||
"common.verb.pull": { "base": "pullen", "past": "gepullt", "gerund": "pullend" },
|
||||
"common.verb.commit": { "base": "committen", "past": "committet", "gerund": "committend" },
|
||||
"gram.verb.delete": { "base": "löschen", "past": "gelöscht", "gerund": "löschend" },
|
||||
"gram.verb.save": { "base": "speichern", "past": "gespeichert", "gerund": "speichernd" },
|
||||
"gram.verb.create": { "base": "erstellen", "past": "erstellt", "gerund": "erstellend" },
|
||||
"gram.verb.update": { "base": "aktualisieren", "past": "aktualisiert", "gerund": "aktualisierend" },
|
||||
"gram.verb.build": { "base": "bauen", "past": "gebaut", "gerund": "bauend" },
|
||||
"gram.verb.run": { "base": "laufen", "past": "gelaufen", "gerund": "laufend" },
|
||||
"gram.verb.check": { "base": "prüfen", "past": "geprüft", "gerund": "prüfend" },
|
||||
"gram.verb.install": { "base": "installieren", "past": "installiert", "gerund": "installierend" },
|
||||
"gram.verb.push": { "base": "pushen", "past": "gepusht", "gerund": "pushend" },
|
||||
"gram.verb.pull": { "base": "pullen", "past": "gepullt", "gerund": "pullend" },
|
||||
"gram.verb.commit": { "base": "committen", "past": "committet", "gerund": "committend" },
|
||||
|
||||
"common.noun.file": { "one": "Datei", "other": "Dateien", "gender": "feminine" },
|
||||
"common.noun.repo": { "one": "Repository", "other": "Repositories", "gender": "neuter" },
|
||||
"common.noun.commit": { "one": "Commit", "other": "Commits", "gender": "masculine" },
|
||||
"common.noun.branch": { "one": "Branch", "other": "Branches", "gender": "masculine" },
|
||||
"common.noun.change": { "one": "Änderung", "other": "Änderungen", "gender": "feminine" },
|
||||
"common.noun.item": { "one": "Element", "other": "Elemente", "gender": "neuter" },
|
||||
"gram.noun.file": { "one": "Datei", "other": "Dateien", "gender": "feminine" },
|
||||
"gram.noun.repo": { "one": "Repository", "other": "Repositories", "gender": "neuter" },
|
||||
"gram.noun.commit": { "one": "Commit", "other": "Commits", "gender": "masculine" },
|
||||
"gram.noun.branch": { "one": "Branch", "other": "Branches", "gender": "masculine" },
|
||||
"gram.noun.change": { "one": "Änderung", "other": "Änderungen", "gender": "feminine" },
|
||||
"gram.noun.item": { "one": "Element", "other": "Elemente", "gender": "neuter" },
|
||||
|
||||
"common.article.indefinite.masculine": "ein",
|
||||
"common.article.indefinite.feminine": "eine",
|
||||
"common.article.indefinite.neuter": "ein",
|
||||
"common.article.definite.masculine": "der",
|
||||
"common.article.definite.feminine": "die",
|
||||
"common.article.definite.neuter": "das",
|
||||
"gram.article.indefinite.masculine": "ein",
|
||||
"gram.article.indefinite.feminine": "eine",
|
||||
"gram.article.indefinite.neuter": "ein",
|
||||
"gram.article.definite.masculine": "der",
|
||||
"gram.article.definite.feminine": "die",
|
||||
"gram.article.definite.neuter": "das",
|
||||
|
||||
"cli.success": "Erfolg",
|
||||
"cli.error": "Fehler",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"common": {
|
||||
"gram": {
|
||||
"verb": {
|
||||
"be": { "base": "be", "past": "was", "gerund": "being" },
|
||||
"go": { "base": "go", "past": "went", "gerund": "going" },
|
||||
|
|
@ -47,7 +47,9 @@
|
|||
"article": {
|
||||
"indefinite": { "default": "a", "vowel": "an" },
|
||||
"definite": "the"
|
||||
},
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"prompt": {
|
||||
"yes": "y",
|
||||
"no": "n",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue