![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

Hi Gene,
I use a ".INI" initialisation file to do that.
For the dialogbox, I use the dialog title (simplified) like a
section. Below is a sample in my RESOURCE_SPAIN.INI file:
[DLG Bibliotheques]
Title=Biblioteca
Creer=&Crear
Importer=&Importar
Supprimer=&Eliminar
Mise a jour=&Actualizar
When a dialogbox opens, all the text are translated in the WM_INITDIALOG,
with the next Forth word:
: TRANSLATE-DLG ( hdlg -- )
dup TRANSLATE-TEXT
( hdlg) GW_CHILD GetWindow
BEGIN dup WHILE
dup RECURSE
GW_HWNDNEXT GetWindow
REPEAT drop ;
I define initially the dialogbox in French.
TRANSLATE-DLG do the following:
For each child window in dialogbox
take the text, suppress/convert special character to build some
ORIGINAL_STRING.
Search for a match of all VAR_STRING of the _section_ inside the
ORIGINAL_STRING.
If found -> replace the text.
The advantage is that I don't have to use resource identifiers.
The work of the translator is easy:
- open any dialogbox
- create a section with dialog title
- translate title ( Title=Biblioteca )
- for each string, take a signifiant word = VAR_STRING
- translate the string ( VAR_STRING=translated text )
For menu and pure strings, the work is more easy.
[MENU Fichier]
0=&Nuevo
1=&Abrir\tCtrl + O
2=&Guardar\tCtrl + S
3=G&uardar como
4=&Cerrar
5=&Imprimir\tCtrl + P
6=C&onfigurar impresora
7=&Parámetros
8=Con&vertir
8.0=E-&Mail <<<<<< sub-menu
8.1=&Exportar DXF
8.2=&Importar DXF
9=&Salir
[STRINGS]
1=Tamaño. %d x %d
2=Límite tamaño entre 32 y 1024.
3=Pass %d/%d - render line %d / %d - <Esc> para parar"
4=Inicio render radio
5=Listo
....
________
Charles
-----Message d'origine-----
De : sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com] De la part de
Gene LeFave
Envoyé : lundi 14 mai 2007 22:20
À : sftalk_at_forth.com
Objet : [sftalk] multi lingual
Need to get some ideas on multi lingual strings.
I'm looking at the MS message complier in the SDK but not sure of how to
get the message resource attached to an sf exe, or how to create an empty
dll with nothing in it but the string resource. Much less the not
insignificant
task of managing all the strings.
I'm looking at US, UK , French and Spanish. No non latin alphabets.
Seems to me that STRING could convert the given string into a hash
number, place the string into a string resource file (possible?) f it's not
there
and then at run time look it up again, with an added language modifier..
Then we take the resource file and get some translator to write the
translations. Hopefully, this isn't too much harder then it sounds.
Any suggestions are welcome!
Gene
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com For
list command help, send subject "help" to sftalk-request_at_forth.com Message
archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and
bug reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Tue May 15 2007 - 00:26:53 PDT
This archive was generated by hypermail 2.2.0 : Wed Nov 19 2008 - 03:04:29 PST