namespace Sunfish.Cli.Tui;

/// <summary>Textos de la TUI (el idioma lo decide Sunfish.Strings).</summary>
internal static class TuiTexts
{
    private static string T(string english, string spanish) => Strings.Spanish ? spanish : english;

    public static string KeysCommon => T("Tab: next tab  Q: quit", "Tab: pestaña  Q: salir");
    public static string KeysStatus => T("S: start/stop  P: HTTP port  F: FTP on/off  T: FTP port  N: name  C: QR code", "S: arrancar/parar  P: puerto HTTP  F: FTP sí/no  T: puerto FTP  N: nombre  C: código QR");
    public static string KeysQr => T("←/→: other address  any other key: close", "←/→: otra dirección  otra tecla: cerrar");
    public static string NoQr => T("No address to show: start the server with an enabled share.", "No hay direcciones: arranca el servidor con algún share activo.");
    public static string QrTooSmall => T("The terminal is too small for the QR code; this is the address:", "El terminal es demasiado pequeño para el código QR; esta es la dirección:");
    public static string KeysShares => T("A/Ins: add  Enter: edit  Space: on/off  D/Del: remove", "A/Ins: añadir  Enter: editar  Espacio: activar  D/Supr: quitar");
    public static string KeysUsers => T("A/Ins: add  P: password  D/Del: delete", "A/Ins: añadir  P: contraseña  D/Supr: borrar");
    public static string KeysLog => T("Newest at the bottom", "Lo más reciente, abajo");
    public static string ExploreTab => T("Explore", "Explorar");
    public static string KeysExploreServers => T("Enter: connect  A: type an address  R: search again", "Enter: conectar  A: escribir dirección  R: buscar otra vez");
    public static string KeysExploreBrowse => T("Enter: open  Bksp: up  D: download  U: upload  M: new folder  Del: delete  Esc: servers",
        "Enter: abrir  Retroceso: subir  D: descargar  U: subir aquí  M: carpeta  Supr: borrar  Esc: servidores");
    public static string ExploreServersTitle => T("Servers on the local network", "Servidores en la red local");
    public static string ExploreSearching => T("Searching the network...", "Buscando en la red...");
    public static string ExploreNoneFound => T("No servers found. Press A to type an address.", "No se han encontrado servidores. Pulsa A para escribir una dirección.");
    public static string ExploreAddress => T("Address (host:port or http://...):", "Dirección (equipo:puerto o http://...):");
    public static string ExploreBadAddress => T("Invalid address.", "Dirección no válida.");
    public static string ExploreLoading => T("Loading...", "Cargando...");
    public static string ExploreItems(int n) => T($"{n} item(s)", $"{n} elemento(s)");
    public static string ExploreDone => T("Done.", "Hecho.");
    public static string ExploreDownloadTo => T("Download to the local folder:", "Descargar en la carpeta local:");
    public static string ExploreUploadFrom => T("Local file or folder to upload here:", "Fichero o carpeta local a subir aquí:");
    public static string ExploreNewFolder => T("Name of the new folder:", "Nombre de la carpeta nueva:");
    public static string ExploreDownloading(string name) => T($"Downloading {name}...", $"Descargando {name}...");
    public static string ExploreUploading(string name) => T($"Uploading {name}...", $"Subiendo {name}...");
    public static string ExploreDeleteQuestion(string name) => T($"Delete '{name}' on the other server?", $"¿Borrar '{name}' en el otro servidor?");
    public static string ExploreUser(string server) => T($"User for {server}:", $"Usuario para {server}:");
    public static string KeysForm => T("Up/Down: move  Enter: edit/toggle  Esc: cancel", "Arriba/Abajo: mover  Enter: editar/cambiar  Esc: cancelar");
    public static string KeysInput => T("Enter: accept  Esc: cancel", "Enter: aceptar  Esc: cancelar");
    public static string YesNo => T("(y/n)", "(s/n)");
    public static bool IsYes(char c) => char.ToLowerInvariant(c) is 'y' or 's';

    public static string QuitQuestion => T("Quit? The server will stop.", "¿Salir? El servidor se detendrá.");
    public static string Save => T("[ Save ]", "[ Guardar ]");
    public static string Cancel => T("[ Cancel ]", "[ Cancelar ]");
    public static string NewShareFolder => T("Folder to share:", "Carpeta a compartir:");
    public static string EditShare(string name) => T($"Share '{name}'", $"Share '{name}'");
    public static string NewUserName => T("Name of the new user:", "Nombre del usuario nuevo:");
    public static string NewPassword(string name) => T($"Password for '{name}':", $"Contraseña de '{name}':");
    public static string RepeatPassword => T("Repeat the password:", "Repite la contraseña:");
    public static string PasswordMismatch => T("The passwords do not match.", "Las contraseñas no coinciden.");
    public static string PortPrompt => T("HTTP port (1-65535):", "Puerto HTTP (1-65535):");
    public static string FtpPortPrompt => T("FTP port (1-65535):", "Puerto FTP (1-65535):");
    public static string NamePrompt => T("Server name:", "Nombre del servidor:");
    public static string BadPort => T("Invalid port.", "Puerto no válido.");
    public static string Config(string path) => T($"Configuration: {path}", $"Configuración: {path}");
    public static string NoUsers => T("No users. Shares without users are public.", "No hay usuarios. Los shares sin usuarios son públicos.");
    public static string UsedIn(string shares) => T($"shares: {shares}", $"shares: {shares}");
    public static string Permissions => T("L=list U=upload O=overwrite R=rename D=delete Z=zip", "L=listar U=subir O=sobrescribir R=renombrar D=borrar Z=zip");
    public static string ColPerms => T("Perms", "Permisos");
    public static string ColUsers => T("Users", "Usuarios");
    public static string Saved => T("Saved.", "Guardado.");
    public static string NotSavedQuick => T("Quick share: changes are not saved to a file.", "Compartido al momento: los cambios no se guardan en ningún fichero.");

    public static string NoConfigQuestion(string portable, string user) => T(
        $"There is no configuration file yet. Create it:\n  1) next to the program: {portable}\n  2) in your user folder: {user}\n  Esc) quit\nChoose 1 or 2: ",
        $"Aún no hay fichero de configuración. Crearlo:\n  1) junto al programa: {portable}\n  2) en tu carpeta de usuario: {user}\n  Esc) salir\nElige 1 o 2: ");
}
