Giter Site home page Giter Site logo

Locale support about httpdownloader HOT 11 CLOSED

erickutcher avatar erickutcher commented on July 21, 2024
Locale support

from httpdownloader.

Comments (11)

c-sanchez avatar c-sanchez commented on July 21, 2024 1

Ok, I'm not sure if this can be ussefull for now, but the string table in spanish :)
maybe I need improve the traslation a bit later, but I think it's fine like that for now

/*
	HTTP Downloader can download files through HTTP and HTTPS connections.
	Copyright (C) 2015-2018 Eric Kutcher

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "string_tables.h"

// Ordered by month.
wchar_t *month_string_table[] =
{
	L"Enero",
	L"Febrero",
	L"Marzo",
	L"Abril",
	L"Mayo",
	L"Junio",
	L"Julio",
	L"Agosto",
	L"Septiembre",
	L"Octubre",
	L"Noviembre",
	L"Diciembre"
};

// Ordered by day.
wchar_t *day_string_table[] =
{
	L"Domingo",
	L"Lunes",
	L"Martes",
	L"Miércoles",
	L"Jueves",
	L"Viernes",
	L"Sábado"
};

wchar_t *download_string_table[] =
{
	L"#",
	L"Partes activas",
	L"Fecha y Hora añadidas",
	L"Directorio de descarga",
	L"Velocidad de descarga",
	L"Descargado",
	L"Tamaño de archivo",
	L"Tipo de archivo",
	L"Nombre de archivo",
	L"Progreso",
	L"Tiempo transcurrido",
	L"Tiempo restante",
	L"Versión de TLS /  SSL",
	L"URL"
};

wchar_t *menu_string_table[] =
{
	L"#",
	L"&Acerca de",
	L"&Agregar URL(s)...",
	L"&Editar",
	L"&Archivo",
	L"A&yuda",
	L"&Opciones...",
	L"&Pausa",
	L"&Quitar",
	L"&Seleccionar todo",
	L"&Herramientas",
	L"&Ver",
	L"Partes activas",
	L"Agregar URL(s)...",
	L"Copiar URL(s)",
	L"Fecha y Hora añadidas",
	L"Eliminar",
	L"Directorio de descarga",
	L"Velocidad de descarga",
	L"Descargado",
	L"&Salir",
	L"Salir",
	L"&Exportar historial de descargas...",
	L"Tamaño de archivo",
	L"Tipo de archivo",
	L"Nombre de archivo",
	L"Página de inicio de &HTTP Downloader",
	L"&Importar historial de descargas...",
	L"Bajar",
	L"Mover al final",
	L"Mover al principio",
	L"Subir",
	L"Abrir directorio",
	L"Abrir archivo",
	L"Abrir lista de descargas",
	L"Opciones...",
	L"Pausa",
	L"Pausar activo",
	L"Progreso",
	L"Cola",
	L"Quitar",
	L"Quitar completado",
	L"Renombrar",
	L"&Guardar historial de descargas...",
	L"Seleccionar todo",
	L"&Iniciar",
	L"Iniciar",
	L"&Barra de estado",
	L"&Parar",
	L"Parar",
	L"Parar todo",
	L"Tiempo transcurrido",
	L"Tiempo restante",
	L"Versión de TLS /  SSL",
	L"&Barra de herramientas",
	L"Actualizar descarga...",
	L"URL"
};

wchar_t *options_string_table[] =
{
	L":",
	L"Límite de descarga activa:",
	L"Permitir ejecutar sólo una instancia del programa",
	L"Siempre en la parte superior",
	L"Aplicar",
	L"Autenticación básica",
	L"Archivo de certificado:",
	L"Cerrar a la bandeja del sistema",
	L"Configurar proxies",
	L"Conexión",
	L"Directorio de descarga por defecto:",
	L"Partes de descarga por defecto:",
	L"Versión de SSL / TLS por defecto:",
	L"Autenticación de resúmenes",
	L"Activar historial de descargas",
	L"Activar proxy HTTP",
	L"Activar proxy HTTPS",
	L"Activar asignación rápida de archivos (se requiere acceso de administrador)",
	L"Activar servidor:",
	L"Activar SSL / TLS:",
	L"Activar icono de bandeja del sistema:",
	L"Activar ventana para soltar URL",
	L"General",
	L"Nombre de host / dirección IPv6:",
	L"Dirección IPv4:",
	L"Archivo de clave:",
	L"Cargar archivo PKCS #12",
	L"Cargar archivo de clave privada",
	L"Cargar archivo de certificado X.509",
	L"Redirecciones maximas:",
	L"Minimizar a la bandeja del sistema",
	L"Aceptar",
	L"PKCS #12:",
	L"Archivo PKCS #12:",
	L"Contraseña PKCS #12:",
	L"Puerto:",
	L"Proxy",
	L"Par de claves públicas / privadas:",
	L"Requiere autenticación:",
	L"Reintentar descargas incompletas:",
	L"Reintentar partes incompletas:",
	L"Servidor SSL / Versión TLS:",
	L"Definir fecha y hora de archivo desde la respuesta del servidor",
	L"Cuenta de grupo de hilos:",
	L"Tiempo de espera (segundos):"
};

wchar_t *add_urls_string_table[] =
{
	L"Avanzado \xAB",
	L"Avanzado \xBB",
	L"Autenticación",
	L"Cookies:",
	L"Descargar",
	L"Descargar directorio:",
	L"Descargar partes:",
	L"Cabeceras:",
	L"Contraseña:",
	L"Simular descarga",
	L"Versión de SSL / TLS:",
	L"URL(s):",
	L"Usuario:"
};

wchar_t *common_string_table[] =
{
	L"...",
	L"[Simulado]",
	L"Agregar URL(s)",
	L"Asignando archivo",
	L"Autorización requerida",
	L"Cancelar",
	L"Completado",
	L"Conectando",
	L"Velocidad de descarga: ",
	L"Velocidad de descarga: 0 B/s",
	L"Velocidad de descarga: 0.00 GB/s",
	L"Velocidad de descarga: 0.00 KB/s",
	L"Velocidad de descarga: 0.00 MB/s",
	L"Exportar historial de descargas",
	L"Fallido",
	L"Error de E/S de archivo",
	L"Importar historial de descargas",
	L"Opciones",
	L"Pausado",
	L"Autenticación de proxy requerida",
	L"En cola",
	L"Guardar historial de descargas",
	L"Saltado",
	L"Detenido",
	L"SSL 2.0",
	L"SSL 3.0",
	L"Desconectado",
	L"TLS 1.0",
	L"TLS 1.1",
	L"TLS 1.2",
	L"Total descargado: ",
	L"Total descargado: 0 B",
	L"Total descargado: 0.00 GB",
	L"Total descargado: 0.00 KB",
	L"Total descargado: 0.00 MB",
	L"URL:",
	L"Actualizar",
	L"Actualizar descarga"
};

wchar_t *common_message_string_table[] =
{
	L"Se requiere un reinicio para que estos cambios surtan efecto.",
	L"Se requiere un reinicio para activar la asignación rápida de archivos.",
	L"Se requiere un reinicio para actualizar la cuenta del grupo de hilos.",
	L"¿Realmente desea eliminar los archivos seleccionados?",
	L"¿Realmente desea eliminar las entradas completadas?",
	L"¿Realmente desea eliminar las entradas seleccionadas?",
	L"Uno o más archivos están en uso y no se pueden eliminar.",
	L"Uno o más archivos no fueron encontrados.",
	L"Seleccione el directorio de descarga por defecto.",
	L"Seleccione el directorio de descarga.",
	L"La descarga se reanudará después de su actualización..",
	L"El archivo está actualmente en uso y no se puede eliminar.",
	L"No se pudo importar porque el formato es incorrecto.",
	L"No se ha encontrado el archivo especificado.\r\n\r\n¿Desea volver a descargar el archivo?",
	L"No se encontró la ruta especificada.",
	L"Ya hay un archivo con el mismo nombre en esta ubicación.",
	L"Debe proporcionar un directorio de descarga."
};

from httpdownloader.

erickutcher avatar erickutcher commented on July 21, 2024 1

I've attached some files to help in creating a compatible locale file. The first is string_list.txt which contains all of the strings that are currently in the program. You'll want to go through it and translate them into your language. Make sure to keep the strings in the same order and not remove any duplicate values. Also make sure that when you save the file that it's saved in UTF-8 without the byte order mark (BOM). If you're familiar with Notepad++, then you can go into its Encoding menu and select "Encode in UTF-8" or "Convert to UTF-8".

The next file contains a program (and it's source code if you're interested) that'll convert the string_list.txt file into a locale file. It'll name the output file based on your system's current language. If it can't find a locale name, it'll default to "default". Just place the string_list.txt file in the same folder (Release) as locale_generator.exe and run the program. It's a simple command-line program that'll finish in half a second, but after it's done there will be a locale file saved to the same folder.

If you're not able to get the program working, you can just send me a copy of the translated string_list.txt file. I'll generate the locale file from it.

The locale file itself is just all of those strings with the carriage return and newline character pairs replaced with null, and all of the escaped string characters replaced with their binary equivalent. It's also in a wide character format.

string_list.txt
locale_generator.zip

from httpdownloader.

erickutcher avatar erickutcher commented on July 21, 2024

I've given this some thought in the past and ended up coalescing all of the translatable text into one source file. A .ini file would be the best approach when implementing it. I will consider it for a future release.

Here's all of the necessary strings in the program: https://github.com/erickutcher/httpdownloader/blob/master/HTTP_Downloader/string_tables.cpp

from httpdownloader.

erickutcher avatar erickutcher commented on July 21, 2024

I will keep a reference to this and try to figure out how to implement language support. That might take a while though. I appreciate the time you took to translate it.

from httpdownloader.

c-sanchez avatar c-sanchez commented on July 21, 2024

Hi @erickutcher, I apologize for the delay.
Here the Spanish locale file, I think maybe I will need improve this a bit later, but well.
haha btw, the locale generator have an small issue with Windows XP too.
GetUserDefaultLocaleName in KERNEL32.dll
string_list.txt

from httpdownloader.

erickutcher avatar erickutcher commented on July 21, 2024

Excellent. Thanks for letting me know about that function too. It's sometimes difficult to know which functions work on older systems since Microsoft keeps changing their MSDN site.

That function is suppose to return the user's language code. Something like en-US, es-ES, de-DE, etc.

I added it to HTTP Downloader so that it could read in a language file of the same name. Since there's no equivalent function in Windows XP it won't be able to load it. That's not a problem though. If it fails to get a name or the function doesn't exist, then it'll try loading a file named "default" instead.

I'll make note of all of this and what to do when I release the next version of the program.

from httpdownloader.

c-sanchez avatar c-sanchez commented on July 21, 2024

Well I remember SwiftSearch wich have an option to check the system locale code, and this is working with XP without any problem.
Maybe you can check SwiftSearch and find how does that :P

from httpdownloader.

erickutcher avatar erickutcher commented on July 21, 2024

It's reading the values from the registry. Seems like a hack approach. There's a proper way, but it would require some COM code. I'll look into it. It's really not critical what the file is named. I just did it this way for consistency.

from httpdownloader.

erickutcher avatar erickutcher commented on July 21, 2024

I didn't include any locale files with the released, but they can be downloaded here: https://github.com/erickutcher/httpdownloader/tree/master/HTTP_Downloader/locale

Since you're on Windows XP, you'll need to rename the Spanish locale "es-ES" to "default". I opted not to add the COM code to detect the language on older systems because it's not all that important what the file is named. And setting the program up to read the locale file is a one time thing. So it shouldn't be too much of an inconvenience.

Anyway, to get the program to read the locale file, you'll want to create a folder called "locale" in the same folder as HTTP Downloader. Then just copy the locale file to that folder. Again, you'll also want to rename the locale file as "default".

from httpdownloader.

smaragdus avatar smaragdus commented on July 21, 2024

@erickutcher

What about packing the language files into an archive ('Languages.zip') and publishing it with new releases?

from httpdownloader.

erickutcher avatar erickutcher commented on July 21, 2024

I suppose I can do that. I always trash extra languages when I install things because they take up unnecessary space.

from httpdownloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.