
-- rChat: localization
-- English and German translations

local A, L = ...

L.Locale = {}

-- Detect game locale
local locale = GetLocale()

-----------------------------
-- English (default)
-----------------------------
L.Locale.enUS = {
    -- Addon info
    ["ADDON_NAME"] = "rChat",
    ["ADDON_LOADED"] = "rChat loaded successfully!",
    
    -- GUI
    ["GUI_TITLE"] = "rChat Settings",
    ["GUI_RELOAD_WARNING"] = "Some settings require a UI reload to take effect.",
    ["GUI_RELOAD_BUTTON"] = "Reload UI",
    
    -- Chicchai section
    ["CHICCHAI_HEADER"] = "Chicchai (Auto-Minimize Chat)",
    ["CHICCHAI_ENABLE"] = "Enable Chicchai Mode",
    ["CHICCHAI_ENABLE_DESC"] = "Automatically minimize chat windows after inactivity",
    
    ["CHICCHAI_EDITMODE_NOTE"] = "Tip: Use Edit Mode (ESC > Edit Mode) to set chat size and position.",
    
    ["CHICCHAI_ANIM_TIME"] = "Animation Time",
    ["CHICCHAI_ANIM_TIME_DESC"] = "Duration of minimize/maximize animation (in seconds)",
    
    ["CHICCHAI_MIN_TIME"] = "Minimize After",
    ["CHICCHAI_MIN_TIME_DESC"] = "Automatically minimize after X seconds of inactivity",
    
    ["CHICCHAI_MIN_LINES"] = "Minimized Lines",
    ["CHICCHAI_MIN_LINES_DESC"] = "Number of chat lines visible when minimized",
    
    ["CHICCHAI_MOUSE_OVER"] = "Maximize on Mouse Over",
    ["CHICCHAI_MOUSE_OVER_DESC"] = "Automatically maximize when hovering over chat",
    
    ["CHICCHAI_COMBAT_LOCK"] = "Lock in Combat",
    ["CHICCHAI_COMBAT_LOCK_DESC"] = "Prevent maximizing during combat",
    
    ["CHICCHAI_COMBAT_LOG"] = "Always Show Combat Log",
    ["CHICCHAI_COMBAT_LOG_DESC"] = "Keep combat log frame always maximized",
    
    -- Chat settings
    ["CHAT_HEADER"] = "Chat Settings",
    ["CHAT_ALWAYS_SHOW_TABS"] = "Always Show Tabs",
    ["CHAT_ALWAYS_SHOW_TABS_DESC"] = "Chat tabs (General, Combat Log) stay visible and don't fade out",
    ["CHAT_SHOW_TIMESTAMP"] = "Show Timestamp",
    ["CHAT_SHOW_TIMESTAMP_DESC"] = "Display timestamps (Hour:Minute) before each chat message",
    ["CHAT_SHOW_PLAYER_LEVEL"] = "Show Player Level",
    ["CHAT_SHOW_PLAYER_LEVEL_DESC"] = "Display player level to the left of the player name",
    ["CHAT_EDITBOX_POSITION"] = "Editbox Position",
    ["CHAT_EDITBOX_POSITION_DESC"] = "Position of the input box (Top or Bottom)",
    ["CHAT_EDITBOX_TOP"] = "Top",
    ["CHAT_EDITBOX_BOTTOM"] = "Bottom",
    ["CHAT_ENABLE_URL_COPY"] = "URL Copy Function",
    ["CHAT_ENABLE_URL_COPY_DESC"] = "Clicking a link opens a copy window",
    ["CHAT_ENABLE_COPY_BUTTON"] = "Show Chat Copy Button",
    ["CHAT_ENABLE_COPY_BUTTON_DESC"] = "Shows a button at the bottom left to copy the entire chat",
    ["CHAT_FADE_TIME"] = "Chat Fade Time",
    ["CHAT_FADE_TIME_DESC"] = "Time in seconds until chat messages fade out (default: 20)",
    ["CHAT_COPY_WINDOW_TITLE"] = "Copy Chat",
    ["CHAT_COPY_INSTRUCTION"] = "Press CTRL+A to select all and CTRL+C to copy",
    ["CHAT_COPY_BUTTON_TOOLTIP"] = "Copy chat history",
    ["CHAT_COPY_ALL_BUTTON"] = "Copy All",
    ["CHAT_COPIED_SUCCESS"] = "Chat copied to clipboard!",
    
    -- Commands
    ["CMD_HELP"] = "Available commands:",
    ["CMD_CONFIG"] = "/rchat config - Open settings window",
    ["CMD_TOGGLE"] = "/rchat toggle - Toggle Chicchai mode",
    ["CMD_RESET"] = "/rchat reset - Reset to default settings",
    
    -- Minimap
    ["MINIMAP_ICON_SHOW"] = "Show Minimap Icon",
    ["MINIMAP_ICON_SHOW_DESC"] = "Show or hide the minimap icon for quick access to settings",
    ["MINIMAP_TOOLTIP"] = "rChat\n|cff33ff99Left-click:|r Open settings\n|cff33ff99Right-click:|r Toggle Chicchai",
}

-----------------------------
-- German
-----------------------------
L.Locale.deDE = {
    -- Addon info
    ["ADDON_NAME"] = "rChat",
    ["ADDON_LOADED"] = "rChat erfolgreich geladen!",
    
    -- GUI
    ["GUI_TITLE"] = "rChat Einstellungen",
    ["GUI_RELOAD_WARNING"] = "Einige Einstellungen erfordern ein UI-Neuladen.",
    ["GUI_RELOAD_BUTTON"] = "UI neu laden",
    
    -- Chicchai section
    ["CHICCHAI_HEADER"] = "Chicchai (Chat automatisch minimieren)",
    ["CHICCHAI_ENABLE"] = "Chicchai-Modus aktivieren",
    ["CHICCHAI_ENABLE_DESC"] = "Chat-Fenster nach Inaktivität automatisch minimieren",
    
    ["CHICCHAI_EDITMODE_NOTE"] = "Tipp: Benutze Edit Mode (ESC > Edit Mode) um Chat-Größe und Position einzustellen.",
    
    ["CHICCHAI_ANIM_TIME"] = "Animationszeit",
    ["CHICCHAI_ANIM_TIME_DESC"] = "Dauer der Minimieren/Maximieren-Animation (in Sekunden)",
    
    ["CHICCHAI_MIN_TIME"] = "Minimieren nach",
    ["CHICCHAI_MIN_TIME_DESC"] = "Automatisch minimieren nach X Sekunden Inaktivität",
    
    ["CHICCHAI_MIN_LINES"] = "Minimierte Zeilen",
    ["CHICCHAI_MIN_LINES_DESC"] = "Anzahl sichtbarer Chat-Zeilen wenn minimiert",
    
    ["CHICCHAI_MOUSE_OVER"] = "Bei Maus-Over maximieren",
    ["CHICCHAI_MOUSE_OVER_DESC"] = "Automatisch maximieren wenn Maus über dem Chat ist",
    
    ["CHICCHAI_COMBAT_LOCK"] = "Im Kampf sperren",
    ["CHICCHAI_COMBAT_LOCK_DESC"] = "Maximieren während des Kampfes verhindern",
    
    ["CHICCHAI_COMBAT_LOG"] = "Kampflog immer anzeigen",
    ["CHICCHAI_COMBAT_LOG_DESC"] = "Kampflog-Fenster immer maximiert halten",
    
    -- Chat settings
    ["CHAT_HEADER"] = "Chat-Einstellungen",
    ["CHAT_ALWAYS_SHOW_TABS"] = "Tabs immer sichtbar",
    ["CHAT_ALWAYS_SHOW_TABS_DESC"] = "Chat-Tabs (Allgemein, Kampflog) bleiben dauerhaft sichtbar und verblassen nicht",
    ["CHAT_SHOW_TIMESTAMP"] = "Zeitstempel anzeigen",
    ["CHAT_SHOW_TIMESTAMP_DESC"] = "Zeigt Zeitstempel (Stunde:Minute) vor jeder Chat-Nachricht an",
    ["CHAT_SHOW_PLAYER_LEVEL"] = "Spielerlevel anzeigen",
    ["CHAT_SHOW_PLAYER_LEVEL_DESC"] = "Zeigt das Level des Spielers links neben dem Namen an",
    ["CHAT_EDITBOX_POSITION"] = "Editbox Position",
    ["CHAT_EDITBOX_POSITION_DESC"] = "Position der Eingabebox (Oben oder Unten)",
    ["CHAT_EDITBOX_TOP"] = "Oben",
    ["CHAT_EDITBOX_BOTTOM"] = "Unten",
    ["CHAT_ENABLE_URL_COPY"] = "URL-Kopierfunktion",
    ["CHAT_ENABLE_URL_COPY_DESC"] = "Klick auf einen Link öffnet ein Kopierfenster",
    ["CHAT_ENABLE_COPY_BUTTON"] = "Chat-Kopierbutton anzeigen",
    ["CHAT_ENABLE_COPY_BUTTON_DESC"] = "Zeigt einen Button unten links zum Kopieren des gesamten Chats",
    ["CHAT_FADE_TIME"] = "Chat-Ausblendverzögerung",
    ["CHAT_FADE_TIME_DESC"] = "Zeit in Sekunden bis Chat-Nachrichten verblassen (Standard: 20)",
    ["CHAT_COPY_WINDOW_TITLE"] = "Chat kopieren",
    ["CHAT_COPY_INSTRUCTION"] = "Drücke STRG+A zum Markieren und STRG+C zum Kopieren",
    ["CHAT_COPY_BUTTON_TOOLTIP"] = "Chat-Verlauf kopieren",
    ["CHAT_COPY_ALL_BUTTON"] = "Alles kopieren",
    ["CHAT_COPIED_SUCCESS"] = "Chat in Zwischenablage kopiert!",
    
    -- Commands
    ["CMD_HELP"] = "Verfügbare Befehle:",
    ["CMD_CONFIG"] = "/rchat config - Öffnet das Einstellungsfenster",
    ["CMD_TOGGLE"] = "/rchat toggle - Chicchai-Modus an/aus",
    ["CMD_RESET"] = "/rchat reset - Auf Standardeinstellungen zurücksetzen",
    
    -- Minimap
    ["MINIMAP_ICON_SHOW"] = "Minimap-Symbol anzeigen",
    ["MINIMAP_ICON_SHOW_DESC"] = "Minimap-Symbol für schnellen Zugriff auf Einstellungen anzeigen oder ausblenden",
    ["MINIMAP_TOOLTIP"] = "rChat\n|cff33ff99Linksklick:|r Einstellungen öffnen\n|cff33ff99Rechtsklick:|r Chicchai an/aus",
}

-- Set locale based on game language
if locale == "deDE" then
    L.Strings = L.Locale.deDE
else
    L.Strings = L.Locale.enUS -- Default to English
end

-- Fallback function
setmetatable(L.Strings, {
    __index = function(t, k)
        return L.Locale.enUS[k] or k
    end
})
