local addonName, FN = ...

FN = FN or FavoriteNeighborhood or {}
FavoriteNeighborhood = FN
FN.L = FN.L or {}

local L = FN.L
local locale = GetLocale()

local enUS = {
    ["Left Click: Open/close options"] = "Left Click: Open/close options",
    ["FavoriteNeighborhood"] = "FavoriteNeighborhood",
    ["Registered Characters"] = "Registered Characters",
    ["Saved characters that logged into the addon. The current character stays at the top, followed by the most recently played ones."] = "Saved characters that logged into the addon.",
    ["Character"] = "Character",
    ["Level"] = "Level",
    ["Faction"] = "Faction",
    ["Realm"] = "Realm",
    ["Remove"] = "Remove",
    ["Remove %s from the registered list?"] = "Remove %s from the registered list?",
    ["Choose your all-time favorite neighborhood.\nAuto switch can manage the active neighborhood for your whole account."] = "Choose your all-time favorite neighborhood.\nAuto switch can manage the active neighborhood for your whole account.",
    ["Account"] = "Account",
    ["All-time Favorite"] = "All-time Favorite",
    ["Collecting for: None"] = "Collecting for: None",
    ["Collecting for: %s"] = "Collecting for: %s",
    ["Auto switch for account"] = "Auto switch for account",
    ["Close"] = "Close",
    ["Preview"] = "Preview",
    ["Bar fill"] = "Bar fill",
    ["Animated (20%% steps)"] = "Animated (20% steps)",
    ["Debug"] = "Debug",
    ["All neighborhoods completed"] = "All neighborhoods completed",
    ["Switch recommended"] = "Switch recommended",
    ["Completed - switching recommended"] = "Completed - switching recommended",
    ["Progress: %d%%"] = "Progress: %d%%",
    ["Using housing progress bar texture"] = "Using housing progress bar texture",
    ["None"] = "None",
    ["debug mode enabled."] = "debug mode enabled.",
    ["debug mode disabled."] = "debug mode disabled.",
    ["options frame error: %s"] = "options frame error: %s",
    ["toggle function not ready."] = "toggle function not ready.",
}

local deDE = {
    ["Left Click: Open/close options"] = "Links Klick: Öffnen/Schließen",
    ["FavoriteNeighborhood"] = "FavoriteNeighborhood",
    ["Registered Characters"] = "Registrierte Charaktere",
    ["Saved characters that logged into the addon. The current character stays at the top, followed by the most recently played ones."] = "Gespeicherte Charaktere, die sich mit dem Addon eingeloggt haben.",
    ["Character"] = "Charakter",
    ["Level"] = "Stufe",
    ["Faction"] = "Fraktion",
    ["Realm"] = "Realm",
    ["Remove"] = "Entfernen",
    ["Remove %s from the registered list?"] = "%s aus der registrierten Liste entfernen?",
    ["Choose your all-time favorite neighborhood.\nAuto switch can manage the active neighborhood for your whole account."] = "Wähle deine dauerhafte Lieblingsnachbarschaft.\nDer Auto-Wechsel kann die aktive Nachbarschaft für deinen ganzen Account verwalten.",
    ["Account"] = "Account",
    ["All-time Favorite"] = "Dauerhafter Favorit",
    ["Collecting for: None"] = "Sammeln für: Keine",
    ["Collecting for: %s"] = "Sammeln für: %s",
    ["Auto switch for account"] = "Auto-Wechsel für Account",
    ["Close"] = "Schließen",
    ["Preview"] = "Vorschau",
    ["Bar fill"] = "Balkenfüllung",
    ["Animated (20%% steps)"] = "Animiert (20% Schritte)",
    ["Debug"] = "Debug",
    ["All neighborhoods completed"] = "Alle Nachbarschaften abgeschlossen",
    ["Switch recommended"] = "Wechsel empfohlen",
    ["Completed - switching recommended"] = "Abgeschlossen - Wechsel empfohlen",
    ["Progress: %d%%"] = "Fortschritt: %d%%",
    ["Using housing progress bar texture"] = "Verwendet die Housing-Fortschrittsbalken-Textur",
    ["None"] = "Keine",
    ["debug mode enabled."] = "Debug-Modus aktiviert.",
    ["debug mode disabled."] = "Debug-Modus deaktiviert.",
    ["options frame error: %s"] = "Fehler im Optionsfenster: %s",
    ["toggle function not ready."] = "Umschaltfunktion noch nicht bereit.",
}

local selected = (locale == "deDE") and deDE or enUS

setmetatable(L, {
    __index = function(_, key)
        local value = selected[key] or enUS[key] or key
        rawset(L, key, value)
        return value
    end,
})

for k, v in pairs(selected) do
    L[k] = v
end
