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:
|
case map[string]any:
|
||||||
// Check if this is a verb form object
|
// Check if this is a verb form object
|
||||||
|
// Grammar data lives under "gram.*" (a nod to Gram - grandmother)
|
||||||
if grammar != nil && isVerbFormObject(v) {
|
if grammar != nil && isVerbFormObject(v) {
|
||||||
verbName := key
|
verbName := key
|
||||||
if strings.HasPrefix(fullKey, "common.verb.") {
|
if strings.HasPrefix(fullKey, "gram.verb.") {
|
||||||
verbName = strings.TrimPrefix(fullKey, "common.verb.")
|
verbName = strings.TrimPrefix(fullKey, "gram.verb.")
|
||||||
}
|
}
|
||||||
forms := VerbForms{}
|
forms := VerbForms{}
|
||||||
if base, ok := v["base"].(string); ok {
|
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
|
// Check if this is a noun form object
|
||||||
if grammar != nil && isNounFormObject(v) {
|
if grammar != nil && isNounFormObject(v) {
|
||||||
nounName := key
|
nounName := key
|
||||||
if strings.HasPrefix(fullKey, "common.noun.") {
|
if strings.HasPrefix(fullKey, "gram.noun.") {
|
||||||
nounName = strings.TrimPrefix(fullKey, "common.noun.")
|
nounName = strings.TrimPrefix(fullKey, "gram.noun.")
|
||||||
}
|
}
|
||||||
forms := NounForms{}
|
forms := NounForms{}
|
||||||
if one, ok := v["one"].(string); ok {
|
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
|
// 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 indef, ok := v["indefinite"].(map[string]any); ok {
|
||||||
if def, ok := indef["default"].(string); ok {
|
if def, ok := indef["default"].(string); ok {
|
||||||
grammar.Articles.IndefiniteDefault = def
|
grammar.Articles.IndefiniteDefault = def
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,29 @@
|
||||||
{
|
{
|
||||||
"common.verb.delete": { "base": "löschen", "past": "gelöscht", "gerund": "löschend" },
|
"gram.verb.delete": { "base": "löschen", "past": "gelöscht", "gerund": "löschend" },
|
||||||
"common.verb.save": { "base": "speichern", "past": "gespeichert", "gerund": "speichernd" },
|
"gram.verb.save": { "base": "speichern", "past": "gespeichert", "gerund": "speichernd" },
|
||||||
"common.verb.create": { "base": "erstellen", "past": "erstellt", "gerund": "erstellend" },
|
"gram.verb.create": { "base": "erstellen", "past": "erstellt", "gerund": "erstellend" },
|
||||||
"common.verb.update": { "base": "aktualisieren", "past": "aktualisiert", "gerund": "aktualisierend" },
|
"gram.verb.update": { "base": "aktualisieren", "past": "aktualisiert", "gerund": "aktualisierend" },
|
||||||
"common.verb.build": { "base": "bauen", "past": "gebaut", "gerund": "bauend" },
|
"gram.verb.build": { "base": "bauen", "past": "gebaut", "gerund": "bauend" },
|
||||||
"common.verb.run": { "base": "laufen", "past": "gelaufen", "gerund": "laufend" },
|
"gram.verb.run": { "base": "laufen", "past": "gelaufen", "gerund": "laufend" },
|
||||||
"common.verb.check": { "base": "prüfen", "past": "geprüft", "gerund": "prüfend" },
|
"gram.verb.check": { "base": "prüfen", "past": "geprüft", "gerund": "prüfend" },
|
||||||
"common.verb.install": { "base": "installieren", "past": "installiert", "gerund": "installierend" },
|
"gram.verb.install": { "base": "installieren", "past": "installiert", "gerund": "installierend" },
|
||||||
"common.verb.push": { "base": "pushen", "past": "gepusht", "gerund": "pushend" },
|
"gram.verb.push": { "base": "pushen", "past": "gepusht", "gerund": "pushend" },
|
||||||
"common.verb.pull": { "base": "pullen", "past": "gepullt", "gerund": "pullend" },
|
"gram.verb.pull": { "base": "pullen", "past": "gepullt", "gerund": "pullend" },
|
||||||
"common.verb.commit": { "base": "committen", "past": "committet", "gerund": "committend" },
|
"gram.verb.commit": { "base": "committen", "past": "committet", "gerund": "committend" },
|
||||||
|
|
||||||
"common.noun.file": { "one": "Datei", "other": "Dateien", "gender": "feminine" },
|
"gram.noun.file": { "one": "Datei", "other": "Dateien", "gender": "feminine" },
|
||||||
"common.noun.repo": { "one": "Repository", "other": "Repositories", "gender": "neuter" },
|
"gram.noun.repo": { "one": "Repository", "other": "Repositories", "gender": "neuter" },
|
||||||
"common.noun.commit": { "one": "Commit", "other": "Commits", "gender": "masculine" },
|
"gram.noun.commit": { "one": "Commit", "other": "Commits", "gender": "masculine" },
|
||||||
"common.noun.branch": { "one": "Branch", "other": "Branches", "gender": "masculine" },
|
"gram.noun.branch": { "one": "Branch", "other": "Branches", "gender": "masculine" },
|
||||||
"common.noun.change": { "one": "Änderung", "other": "Änderungen", "gender": "feminine" },
|
"gram.noun.change": { "one": "Änderung", "other": "Änderungen", "gender": "feminine" },
|
||||||
"common.noun.item": { "one": "Element", "other": "Elemente", "gender": "neuter" },
|
"gram.noun.item": { "one": "Element", "other": "Elemente", "gender": "neuter" },
|
||||||
|
|
||||||
"common.article.indefinite.masculine": "ein",
|
"gram.article.indefinite.masculine": "ein",
|
||||||
"common.article.indefinite.feminine": "eine",
|
"gram.article.indefinite.feminine": "eine",
|
||||||
"common.article.indefinite.neuter": "ein",
|
"gram.article.indefinite.neuter": "ein",
|
||||||
"common.article.definite.masculine": "der",
|
"gram.article.definite.masculine": "der",
|
||||||
"common.article.definite.feminine": "die",
|
"gram.article.definite.feminine": "die",
|
||||||
"common.article.definite.neuter": "das",
|
"gram.article.definite.neuter": "das",
|
||||||
|
|
||||||
"cli.success": "Erfolg",
|
"cli.success": "Erfolg",
|
||||||
"cli.error": "Fehler",
|
"cli.error": "Fehler",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"common": {
|
"gram": {
|
||||||
"verb": {
|
"verb": {
|
||||||
"be": { "base": "be", "past": "was", "gerund": "being" },
|
"be": { "base": "be", "past": "was", "gerund": "being" },
|
||||||
"go": { "base": "go", "past": "went", "gerund": "going" },
|
"go": { "base": "go", "past": "went", "gerund": "going" },
|
||||||
|
|
@ -47,7 +47,9 @@
|
||||||
"article": {
|
"article": {
|
||||||
"indefinite": { "default": "a", "vowel": "an" },
|
"indefinite": { "default": "a", "vowel": "an" },
|
||||||
"definite": "the"
|
"definite": "the"
|
||||||
},
|
}
|
||||||
|
},
|
||||||
|
"common": {
|
||||||
"prompt": {
|
"prompt": {
|
||||||
"yes": "y",
|
"yes": "y",
|
||||||
"no": "n",
|
"no": "n",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue