Author Topic: how to translate a template  (Read 2492 times)

0 Members and 1 Guest are viewing this topic.

Offline rejetto

  • Administrator
  • Insane programmer
  • *
  • Posts: 12837
    • View Profile
how to translate a template
« on: April 29, 2017, 04:23:35 AM »
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.

Follow members gave a thank to your post:


Offline LeoNeeson

  • Insane poster
  • *****
  • Posts: 404
  • Solitario...
    • View Profile
    • twitter.com/LeoNeeson
Re: how to translate a template
« Reply #1 on: April 29, 2017, 10:58:41 PM »
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, 03:30:04 AM by LeoNeeson »
• HFS ahora también disponible en Español! (Clic aqui) :)
• HFS is now also available in Spanish! (Click here)

Offline Mars

  • Operator
  • Insane poster
  • *****
  • Posts: 1799
    • View Profile
Re: how to translate a template
« Reply #2 on: April 30, 2017, 12:10:19 PM »
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
FRENCH MEMBER : Si vous comprenez la langue française,  n'hésitez pas à l'utiliser pour une meilleure aide de ma part

Offline rejetto

  • Administrator
  • Insane programmer
  • *
  • Posts: 12837
    • View Profile
Re: how to translate a template
« Reply #3 on: May 03, 2017, 02:40:33 AM »
i will fix the default template for next release

Offline LeoNeeson

  • Insane poster
  • *****
  • Posts: 404
  • Solitario...
    • View Profile
    • twitter.com/LeoNeeson
Re: how to translate a template
« Reply #4 on: May 04, 2017, 03:10:54 AM »
@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, 02:55:36 AM by LeoNeeson »
• HFS ahora también disponible en Español! (Clic aqui) :)
• HFS is now also available in Spanish! (Click here)

Offline LeoNeeson

  • Insane poster
  • *****
  • Posts: 404
  • Solitario...
    • View Profile
    • twitter.com/LeoNeeson
Re: how to translate a template
« Reply #5 on: May 09, 2017, 04:02:25 AM »
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 ahora también disponible en Español! (Clic aqui) :)
• HFS is now also available in Spanish! (Click here)

Offline dmatter

  • Occasional poster
  • *
  • Posts: 11
    • View Profile
Re: how to translate a template
« Reply #6 on: May 23, 2017, 08:15:05 AM »
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
  • Insane poster
  • *****
  • Posts: 1799
    • View Profile
Re: how to translate a template
« Reply #7 on: May 23, 2017, 12:13:55 PM »
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, 12:16:04 PM by Mars »
FRENCH MEMBER : Si vous comprenez la langue française,  n'hésitez pas à l'utiliser pour une meilleure aide de ma part

Offline LeoNeeson

  • Insane poster
  • *****
  • Posts: 404
  • Solitario...
    • View Profile
    • twitter.com/LeoNeeson
Re: how to translate a template
« Reply #8 on: May 23, 2017, 08:10:04 PM »
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 ahora también disponible en Español! (Clic aqui) :)
• HFS is now also available in Spanish! (Click here)

Offline ayden8

  • Occasional poster
  • *
  • Posts: 1
    • View Profile
Re: how to translate a template
« Reply #9 on: September 14, 2017, 02:42:59 AM »
Your translate.ini file makes it easy to translate all the strings. Thanks!