Software > HTML & templates
how to translate a template
rejetto:
Hi guys, i think i may never have been clear enough on what is supposed to be the best way to translate a template.
You can have your translation without really touching the template, and that's very important because if you modify the template source you don't get template updates anymore.
The best way that comes to my mind is to right click the home folder > properties > diff template
and paste this text
--- Code: ---[+special:strings]
Size=Dimensione
Timestamp=Data
Name=Nome
.extension=.estensione
Search=Cerca
--- End code ---
There's a way to inject a diff-template via file, that would be good for easier installation, but at the moment it is limited to real folders, and that's quite bad.
In the future i will make it possible to put the file in the hfs.exe folder.
LeoNeeson:
Good information and a very important first step in making HFS multilingual. :)
EDIT: I've updated my Spanish translation, to be used with the fixed default template by Mars (and to be pasted on: Home folder > Properties > Diff template):
--- Code: ---[+special:strings]
Actions=Acciones
All=Todo
Archive=Archivar
Back=Atrás
Bytes=B
Cancel=Cancelar
Change password=Cambiar contraseña
Comment=Comentarios
Delete=Eliminar
Download limit=Límite de descarga
Downloading=Descargando
Either your user name and password do not match, or you are not permitted to access this resource.=Su nombre de usuario y contraseña son incorrectos, o no tiene permitido el acceso a este recurso.
Enter the destination folder=Ingrese la carpeta de destino
Error=Error
Folder1=Carpeta
Forbidden=Prohibido
Get list=Listado
HFS=HFS
Hits=Accesos
Home=Inicio
Invert=Invertir
Login=Ingresar
Mask=Filtrar
Messages=Mensajes
Move=Mover
Moving items to=Moviendo a
Name=Nombre
New folder=Nueva carpeta
No file exchange in progress.=No hay subidas o bajadas de archivos en curso.
No file selected=Ningún archivo fue seleccionado
No file was moved.=Ningún archivo fue movido.
No pages=Mostrar todo
Not found=No encontrado
Page=Página
Paged list=Listar páginas
Password changed, you'll have to login again.=Contraseña cambiada, deberá ingresar nuevamente.
Please enter the file mask to select=Ingrese un filtro para seleccionar archivos
Rename=Renombrar
Search=Buscar
Select=Seleccionar
Server Too Busy=Servidor muy ocupado
Server information=Información del servidor
Server time=Hora del servidor
Server uptime=Tiempo activo
Size=Tamaño
The server is too busy to handle your request at this time. Retry later=El servidor está demasiado ocupado para aceptar su solicitud en este momento. Reintente más tarde
This resource is not accessible.=Este recurso no es accesible.
Timestamp=Fecha y hora
Time left=Tiempo restante
Unauthorized=No autorizado
Up=Arriba
Upload results=Resultados de subida
Upload=Subir
Uploading=Subiendo
User=Usuario
We met the following problems:=Encontramos los siguientes problemas:
Where to search=Dónde buscar
You are banned=Has sido expulsado
.extension=.extensión
already exists=ya existe
bad session=mala sesión
confirm=¿Está usted seguro?
created folder=crear carpeta
entire server=todo el servidor
exists=existe
failed=falló
files failed=archivo/s fallaron
files uploaded correctly.=archivo/s subidos correctamente.
files were moved.=archivo/s fueron movidos.
files=archivos
folder2=carpeta
folders=carpetas
forbidden=Prohibido
go to root=Ir al inicio
go=Ir
in progress...=en progreso...
item folder=en carpeta
items selected=elementos seleccionados
link=enlace
max s dl msg=Existe un límite en el número de descargas <b>simultáneas</b> en este servidor.<br>Ese límite ha sido alcanzado. Intente nuevamente más tarde.
not authorized=no autorizado
no files=No hay archivos en esta carpeta
not found=no encontrado
no results=No hay elementos que coincidan con su búsqueda
ok=Aceptar
renamed=ha renombrado
retry later=Por favor, intente otra vez más tarde.
this folder and sub-folders=ésta carpeta y subcarpetas
this folder only=ésta carpeta unicamente
to=a
uploaded by=subido por
--- End code ---
@Rejetto: Currently, the following strings can't be translated:
Login=Ingresar
MBytes=Megas
Ok=Aceptar
items selected=elementos seleccionados
(and the text 'folder' (in italics), located below 'Size', also can't be translated)
Do you know how to translate them?...
Thank you! :D
Mars:
As you know, there is a special macro visible in the template that looks for the equivalent in the strings defined in the [special:strings] section and can be used to translate some texts
{.!Primary text|default text.}
If an equivalent to "primary text" is found in the strings then it is the equivalent that appears otherwise it is the "default text" failing that is the "primary text"
What is missing from you, and necessary to update in the template, as example
<a href="~login">Login</a> -->>> <a href="~login">{.!Login.}</a>
[special:strings]
Login=Ingresar
I made the rounds of the missing messages, and a list of the texts that it is possible to translate
MBytes cannot be translated directly because it is a concatenation of "M" with the word "bytes" in an alias.
add bytes=switch|{.cut|-1||$1.}|,|0,1,2,3,4,5,6,7,8,9|$1 {.!Bytes.}|K,M,G,T|$1{.!Bytes.}
The ok of some dialogs is part of javascript, do'nt know where to translate it, especially as a substitute for {.pipe|ok.} in tpl
rejetto:
i will fix the default template for next release
LeoNeeson:
@Mars: Great work! Your translate.ini file makes it very easy to translate all the strings. I've updated my Spanish translation above, and also made some modifications to your edited 'hfs.tpl' file. The following were my modifications (marked in bold the changed part and in green the corrected line):
--- Quote ---<span id='selected-number'>0</span> items selected</p>
<span id='selected-number'>0</span> {.!items selected.}</p>
<img src="/~img8"> {.!Folder.}</legend>
<img src="/~img8"> {.!Folder1|Folder.}</legend>
<td class='nosize'>{.!folder.}<td>
<td class='nosize'>{.!folder2|folder.}<td>
<div id='progress'>in progress...</div>
<div id='progress'>{.!in progress....}</div>
<li> Uploading %total% @ %speed-kb% KB/s
<li> {.!Uploading.} %total% @ %speed-kb% KB/s
{.add to log|{.!User.} %user% {.!renamed.} "{.^x.}" to "{.^y.}".}
{.add to log|{.!User.} %user% {.!renamed.} "{.^x.}" {.!to.} "{.^y.}".}
--- End quote ---
This completes all the modifications done by Mars! :)
« Last Edit: 04-05-2017, 06:30:04 by LeoNeeson »
I've updated my Spanish translation above and uploaded a fixed 'hfs.tpl' file.
« Last Edit: 08-05-2017, 05:55:35 by LeoNeeson »
Added the following reminder to Rejetto about all this.
@Rejetto: Don't forget to check and use my updated 'hfs.tpl file, or apply the modifications listed above.
--- Quote from: rejetto on May 03, 2017, 08:40:33 AM ---i will fix the default template for next release
--- End quote ---
Cool 8) Thanks...
Navigation
[0] Message Index
[#] Next page
Go to full version