From 4a7e57a12343eb6cef15e4c4ec8e63f2baa2e04a Mon Sep 17 00:00:00 2001 From: Shadil A M Date: Thu, 16 Apr 2026 01:45:29 +0530 Subject: [PATCH] feat(i18n): add Malayalam language support --- internal/infrastructure/i18n/locale.go | 3 +- .../tui/screens/settings_screen.go | 3 +- locales/ml.toml | 137 ++++++++++++++++++ 3 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 locales/ml.toml diff --git a/internal/infrastructure/i18n/locale.go b/internal/infrastructure/i18n/locale.go index d6a4b0d..39fbb9f 100644 --- a/internal/infrastructure/i18n/locale.go +++ b/internal/infrastructure/i18n/locale.go @@ -11,10 +11,11 @@ const ( LocaleEN Locale = "en" LocaleRU Locale = "ru" LocaleJA Locale = "ja" + LocaleML Locale = "ml" ) func SupportedLocales() []Locale { - return []Locale{LocaleEN, LocaleRU, LocaleJA} + return []Locale{LocaleEN, LocaleRU, LocaleJA, LocaleML} } func (l Locale) IsValid() bool { diff --git a/internal/presentation/tui/screens/settings_screen.go b/internal/presentation/tui/screens/settings_screen.go index 33e0eae..8ae4f67 100644 --- a/internal/presentation/tui/screens/settings_screen.go +++ b/internal/presentation/tui/screens/settings_screen.go @@ -34,7 +34,7 @@ func NewSettingsScreen(translator i18n.Translator, settingsRepo repository.Setti return &SettingsScreen{ translator: translator, settingsRepo: settingsRepo, - locales: []string{"en", "ru", "ja"}, + locales: []string{"en", "ru", "ja", "ml"}, } } @@ -224,6 +224,7 @@ func (s *SettingsScreen) getLocaleLabel(locale string) string { "en": "[En] - English", "ru": "[Ru] - Русский", "ja": "[Ja] - 日本語", + "ml": "[Ml] - മലയാളം", } if label, ok := labels[locale]; ok { diff --git a/locales/ml.toml b/locales/ml.toml new file mode 100644 index 0000000..6d78638 --- /dev/null +++ b/locales/ml.toml @@ -0,0 +1,137 @@ +[common] +loading = "ലോഡിംഗ്..." +error_prefix = "✗ പിശക്: " +no_note = "(കുറിപ്പില്ല)" +returning = "തിരികെ പോകുന്നു..." +step_label = "ഘട്ടം:" +yes = "അതെ" +no = "ഇല്ല" + +[help.navigation] +menu = "↑/↓: നീക്കുക • Enter: തിരഞ്ഞെടുക്കുക • q: പുറത്തുകടക്കുക" +record_step0 = "←/→: മാറ്റുക • Enter: അടുത്തത് • Esc: തിരികെ" +record_step1 = "Enter: സ്ഥിരീകരിക്കുക • Esc: തിരികെ" +record_step2 = "y/Enter: സംരക്ഷിക്കുക • n/Esc: റദ്ദാക്കുക" +stats = "←/→: കാലയളവ് മാറ്റുക • r: പുതുക്കുക • Esc: തിരികെ" +history = "↑/↓: നീക്കുക • Enter/e: തിരുത്തുക • r: പുതുക്കുക • Esc: തിരികെ" +settings = "↑/↓: തിരഞ്ഞെടുക്കുക • Enter: സ്ഥിരീകരിക്കുക • Esc: തിരികെ" +calendar = "←/→: ദിവസം മാറ്റുക • ↑/↓: ആഴ്ച മാറ്റുക • Enter: തിരഞ്ഞെടുക്കുക • n: പുതിയത് • e: തിരുത്തുക • d: ഇല്ലാതാക്കുക • Esc: തിരികെ" +record_choice = "← / → മാറ്റാൻ, 0-9 നേരിട്ട് നൽകാൻ" + +[menu] +title = "മൂഡ് ഡയറി • നിങ്ങളുടെ വികാരങ്ങൾ ട്രാക്ക് ചെയ്യുക 🌸" +record = "ഇന്നത്തെ മൂഡ് രേഖപ്പെടുത്തുക" +stats = "സ്ഥിതിവിവരക്കണക്ക് കാണുക" +history = "എൻട്രി ചരിത്രം" +exit = "പുറത്തുകടക്കുക" +settings = "ക്രമീകരണങ്ങൾ" +calendar = "കലണ്ടർ" + +[record] +title_new = "📝 മൂഡ് രേഖപ്പെടുത്തുക" +title_edit = "✏️ മൂഡ് തിരുത്തുക" +success_new = "✓ മൂഡ് വിജയകരമായി രേഖപ്പെടുത്തി!" +success_edit = "✓ മൂഡ് വിജയകരമായി അപ്ഡേറ്റ് ചെയ്തു!" +prompt_feeling = "ഇന്ന് നിങ്ങൾക്ക് എങ്ങനെ തോന്നുന്നു?" +prompt_note = "ഒരു കുറിപ്പ് ചേർക്കുക (ഐച്ഛികം):" +prompt_confirm_new = "എൻട്രി സ്ഥിരീകരിക്കുക:" +prompt_confirm_edit = "മാറ്റങ്ങൾ സ്ഥിരീകരിക്കുക:" +saving = "സംരക്ഷിക്കുന്നു..." +box_mood = "മൂഡ്: %s %s (%d/10)" +box_note = "കുറിപ്പ്: %s" +box_date = "തീയതി: %s" +without_note = "(കുറിപ്പില്ല)" + +[stats] +title = "സ്ഥിതിവിവരക്കണക്ക്" +total_entries = "മൊത്തം എൻട്രികൾ" +average = "ശരാശരി നില" +min = "കുറഞ്ഞത്" +max = "കൂടുതൽ" +completion = "പൂർത്തീകരണം" +distribution = "വിതരണം" +no_data = "പ്രദർശിപ്പിക്കാൻ ഡാറ്റയില്ല" +range = "പരിധി" +week = "ആഴ്ച" +month = "മാസം" +quarter = "പാദവർഷം" +year = "വർഷം" +all = "എല്ലാം" +today = "ഇന്ന്" +yesterday = "ഇന്നലെ" +tomorrow = "നാളെ" +after_days = "%d ദിവസങ്ങൾക്ക് ശേഷം" +before_days = "%d ദിവസം മുമ്പ്" + +[history] +title = "എൻട്രി ചരിത്രം" +header_date = "തീയതി" +header_mood = "മൂഡ്" +header_note = "കുറിപ്പ്" +empty = "ഇതുവരെ എൻട്രികളില്ല. ആദ്യ എൻട്രി സൃഷ്ടിക്കാൻ 'n' അമർത്തുക!" + +[edit] +title = "✏️ എൻട്രി തിരുത്തുക" +no_entry_selected = "എൻട്രി തിരഞ്ഞെടുക്കപ്പെട്ടിട്ടില്ല. Esc അമർത്തി മടങ്ങുക." +success_updated = "✓ എൻട്രി വിജയകരമായി അപ്ഡേറ്റ് ചെയ്തു!" +success_deleted = "✓ എൻട്രി വിജയകരമായി ഇല്ലാതാക്കി!" +returning_to_history = "ചരിത്രത്തിലേക്ക് മടങ്ങുന്നു..." +prompt_select_mood = "പുതിയ മൂഡ് തിരഞ്ഞെടുക്കുക:" +prompt_edit_note = "കുറിപ്പ് തിരുത്തുക:" +prompt_confirm_changes = "മാറ്റങ്ങൾ സ്ഥിരീകരിക്കുക:" +delete_title = "⚠️ ഈ എൻട്രി ഇല്ലാതാക്കണോ?" +delete_warning = "%s ലെ എൻട്രി സ്ഥിരമായി ഇല്ലാതാക്കപ്പെടും.\nനിങ്ങൾക്ക് ഉറപ്പാണോ?" + +[settings] +title = "⚙️ ക്രമീകരണങ്ങൾ" +option_language = "ഭാഷ" +option_language_desc = "ഭാഷ തിരഞ്ഞെടുക്കുക" +confirm_change = "ഭാഷ മാറ്റം സ്ഥിരീകരിക്കുക" +confirm_text = "%s ആയി ഭാഷ മാറ്റണോ?\n\nഇന്റർഫേസ് ഉടൻ അപ്ഡേറ്റ് ചെയ്യും." +success_edit = "✓ ഭാഷ വിജയകരമായി മാറ്റി!" + +[settings.language] +en = "ഇംഗ്ലീഷ്" +ru = "റഷ്യൻ" + +[settings.confirm] +save = "സേവ് ചെയ്യുക" + +[mood.level] +0 = "വളരെ വളരെ മോശം" +1 = "മോശം" +2 = "അൽപ്പം മോശം" +3 = "ശരാശരിക്ക് താഴെ" +4 = "ശരാശരി താഴെ" +5 = "നിഷ്പക്ഷം" +6 = "ശരി" +7 = "നല്ലത്" +8 = "വളരെ നല്ലത്" +9 = "മികച്ചത്" +10 = "അതിമനോഹരം" + +[calendar] +no_entry = "എൻട്രിയില്ല (സൃഷ്ടിക്കാൻ 'n' അമർത്തുക)" + +[date.month] +1 = "ജനുവരി" +2 = "ഫെബ്രുവരി" +3 = "മാർച്ച്" +4 = "ഏപ്രിൽ" +5 = "മേയ്" +6 = "ജൂൺ" +7 = "ജൂലൈ" +8 = "ഓഗസ്റ്റ്" +9 = "സെപ്റ്റംബർ" +10 = "ഒക്ടോബർ" +11 = "നവംബർ" +12 = "ഡിസംബർ" + +[date.weekday] +1 = "തിങ്കൾ" +2 = "ചൊവ്വ" +3 = "ബുധൻ" +4 = "വ്യാഴം" +5 = "വെള്ളി" +6 = "ശനി" +0 = "ഞായർ" \ No newline at end of file