rejetto forum

how to translate a template

rejetto · 12 · 20514

0 Members and 1 Guest are viewing this topic.

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
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: [Select]
[+special:strings]
Size=Dimensione
Timestamp=Data
Name=Nome
.extension=.estensione
Search=Cerca

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.


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 859
  • Status: On hiatus       (sporadically here)
    • View Profile
    • twitter.com/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: [Select]
[+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
@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
« Last Edit: May 04, 2017, 09:30:04 AM by LeoNeeson »
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2063
    • View Profile
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


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
i will fix the default template for next release


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 859
  • Status: On hiatus       (sporadically here)
    • View Profile
    • twitter.com/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.}".}
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.

i will fix the default template for next release
Cool 8) Thanks...
 
« Last Edit: May 08, 2017, 08:55:36 AM by LeoNeeson »
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 859
  • Status: On hiatus       (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
Although is nice to be able to translate the default template, RAWR-Designs Templates currently have support for more than 11 languages (English, Spanish, Italian, French, Dutch, German, Swedish, Polish, Russian, Czech, Bulgarian, Ukrainian, Hungarian, Turkish, Chinese and Korean), so that's the best option for anyone who wants to have your HFS server website in your own language. ;)
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline dmatter

  • Occasional poster
  • *
    • Posts: 11
    • View Profile
I'm sorry but on the RAW template, I have not found how to change the language to French.

Can you tell us how to do it?


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2063
    • View Profile
c'est relativement simple et en plus l'explication est en français  ;D

il faut repérer le texte à traduire, le faire précéder de {.!    et le terminer par .}
exemple
{.!Server information.}

il faut une section [+special:strings] dans laquelle on met le texte et sa traduction en respectant la caste des caractères, les espaces sont aussi significatifs

[+special:strings]
Server information=Information serveur
Server information =Information sur le serveur
message_92=Serveur information
{.!Server information.} et {.!Server information .} ne sont pas un même texte le deuxième se terminant par un espace

 la macro {.! .} peut comporter un texte de traduction par défaut
on pourrait référencer tous les textes à traduire comme suit  {.!message_92|Server information.}

si message_92 a son équivalent dans  [+special:strings] c'est l'équivalent qui sera affiché si ce n'est pas une chaine vide

texte affiché -->  Serveur information ou Server information ou message_92

dans le cas de longues phrases il vaut mieux passer par la forme message_xx pour réduire les ajouts dans
[+special:strings]
message_xx=trois petits cochons se promenaient dans les bois

en mettant {.!message_xx|Three little pigs were walking in the woods.} dans le template


le modèle par défaut contient plein d'exemples


« Last Edit: May 23, 2017, 06:16:04 PM by Mars »


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 859
  • Status: On hiatus       (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
I'm sorry but on the RAW template, I have not found how to change the language to French.
Do the following steps:

1) Open "RAWR-Template-0.1.3.tpl" using notepad or any text editor.
2) Locate the following section (you will find this at the beginning):

Quote
--- Available languages:
English   = en  Dutch     = nl
Spanish   = es  French    = fr
Italian   = it  Polish    = pl
Turkish   = tr  Russian   = ru
German    = de  Czech     = cz
Swedish   = se  Bulgarian = bg
Chinese   = cn  Ukrainian = ua
Chinese S = cs  Hungarian = hu
Chinese T = ct  Korean T  = kr

Automatic = auto (default, may not be reliable)

language=auto

Note: Feel free to translate your own or correct
      a value. Use the English language file.
      Post corrections or translations by forum
      or email us - contact[at]rawr-designs.com

3) Change the line marked in red color, to the following text:

Quote
language=fr

4) It's done! :) As simply as change "auto" to "fr"

Cheers,
Leo.-
 
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline ayden8

  • Occasional poster
  • *
    • Posts: 1
    • View Profile
Your translate.ini file makes it easy to translate all the strings. Thanks!
English and Spanish dictionary online


Offline dj

  • Tireless poster
  • ****
    • Posts: 291
  • 👣 🐾
    • View Profile
    • PWAs
Quote
Although is nice to be able to translate the default template, RAWR-Designs Templates currently have support for more than 11 languages
the bad: RAWR strings beginns with lv_
the good: you can use {.!lv_name|{.!Name.}.}

so you can use RAWR-files or translate.ini
done in mobil_light


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 859
  • Status: On hiatus       (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
I'm updating my Spanish translation template (diff) [the previous version is located here], to be used with the default template of the future hfs24rc3.exe (still not released at the time of posting this), or to be temporary used with the template I've already uploaded here (see the post here).

To apply this translation, paste the following text on:
Home folder > Properties > Diff template

Code: [Select]
[+special:strings]
HFS=HFS
Uptime=Tiempo activo
Login=Ingresar
Search=Buscar
Enable multi-selection=Habilitar multi-selecci&oacute;n
Selection=Seleccionar
New folder=Nueva carpeta
Display timestamps=Mostrar fecha y hora
Toggle timestamp=Alternar fecha y hora
Archive=Archivar
Upload=Subir
User=Usuario
Anonymous=Anonimo
Change password=Cambiar contrase&ntilde;a
Mask=Filtrar
Invert=Invertir
Delete=Eliminar
Move=Mover
Go=Ir
Download counter:=Contador de descargas:
NEW=NUEVO
Not found=No encontrado
Server Too Busy=Servidor muy ocupado
Download limit=L&iacute;mite de descarga
Unauthorized=No autorizado
Forbidden=Prohibido
Time left=Tiempo restante
Uploading=Subiendo
Downloading=Descargando
Ok=Aceptar
Error=Error
No access=Sin acceso
Bytes=Bytes
Password changed, you'll have to login again.=Contrase&ntilde;a cambiada, deber&aacute; ingresar nuevamente.
Sorry, you lack permissions for this action=Disculpe, usted no tiene permiso para esta acci&oacute;n.
Download these files as a single archive?=\u00BFDescargar \u00E9stos archivos como un \u00FAnico archivo?
selected=seleccionado/s
title=HTTP File Server
folders=carpetas
files=archivos
this folder and sub-folders=&eacute;sta carpeta y subcarpetas
this folder only=&eacute;sta carpeta &uacute;nicamente
entire server=todo el servidor
item folder=en carpeta
go to root=Ir al inicio
The server is too busy to handle your request at this time. Retry later=El servidor est&aacute; demasiado ocupado para aceptar su solicitud en este momento. Reintente m&aacute;s tarde.
max s dl msg=Existe un l&iacute;mite en el n&uacute;mero de descargas <b>simult&aacute;neas</b> en este servidor.<br>Ese l&iacute;mite ha sido alcanzado. Intente nuevamente m&aacute;s tarde.
Either your user name and password do not match, or you are not permitted to access this resource.=Su nombre de usuario y contrase&ntilde;a son incorrectos, o no tiene permitido el acceso a este recurso.
This resource is not accessible.=Este recurso no es accesible.
You are banned=Has sido expulsado
No file exchange in progress.=No hay subidas o bajadas de archivos en curso.
Moving items to=Moviendo a
already exists=ya existe
not moved=no movido
confirm=\u00BFEst\u00E1 usted seguro?
Enter the destination folder=Ingrese la carpeta de destino
We met the following problems:=Encontramos los siguientes problemas:
files were moved.=archivo/s fueron movidos.
No file was moved.=Ning&uacute;n archivo fue movido.
Please enter the file mask to select=Ingrese un filtro para seleccionar archivos
Sort by=Ordenar por
Name=Nombre
Extension=Extensi\u00F3n
Size=Tama\u00F1o
Timestamp=Fecha y hora
Hits=Accesos
Default=Predeterminado
Rename=Renombrar
Comment=Comentarios
Sort=Ordenar
uploaded by=subido por
Uploaded=Subido
Failed=Fall&oacute;
Queued=En espera
created folder=ha creado la carpeta
renamed=ha renombrado
no files=No hay archivos en esta carpeta
no results=No hay elementos que coincidan con su b&uacute;squeda
Reload page=Recargar p&aacute;gina
More options=M&aacute;s opciones
Speed=Velocidad
to=a

Please report back any issues you could find... ;)
Cheers,
Leo.-
« Last Edit: March 20, 2019, 04:46:54 AM by LeoNeeson »
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.