Jump to content

advice on making app with multiple GUI languages


Recommended Posts


I decided to code an app that has more than 2 languages, It is stand alone & portable with just 1 file. I have no experience doing this, so I figured to ask for some advise on how to do this.

What are the techniques used to program multiple language GUIs?

My current idea is to create several global variables like this, but this is going to get really bukly:

isnt there a better way ?

$Default_lang = 'Eng'

If $Default_lang = 'Eng'    Then ToolTip('test messsage')
If $Default_lang = 'jp'     Then ToolTip('テストメッセージ')
If $Default_lang = 'ru'     Then ToolTip('Тестовое сообщение')
My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
Link to comment
Share on other sites

maby something like this

#include <Array.au3>
$Default_lang = 'Eng'
Global $v
Switch $Default_lang
    Case 'Eng'
        $v = 0
    Case 'France'
        $v = 1
    Case 'Africanis'
        $v = 2
Dim $language[10][3] = [ _
    ['one','un','een'], _
    ['two','deux','twee'], _
    ['three','trois','drie'], _
    ['four','quatre','vier'], _
    ['five','cinq','vyf'], _
    ['six','six ','ses'], _
    ['seven','sept','sewe'], _
    ['eight','huit','agt'], _
    ['nine','neuf','nege'], _
    ['ten','dix','tien'] _
;~ _ArrayDisplay($language)
For $x = 0 To UBound($language)-1
MsgBox(0,'','The End')

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)

There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

Link to comment
Share on other sites

Put your strings into a file:

test message1
Тестовое сообщение1
test message2
Тестовое сообщение2
test message3
Тестовое сообщение3

And then load your string variables from that?

I have not used more than one language either so this might be a bad idea.

Maybe an ini file will work too.

Better yet, separate files for each language.

$variable1 test message1
$variable2 test message2
$variable3 test message3

$variable1 テストメッセージ1
$variable2 テストメッセージ2
$variable3 テストメッセージ3

$variable1 Тестовое сообщение1
$variable2 Тестовое сообщение2
$variable3 Тестовое сообщение3

Even better yet still, XML!

<English>"Test Message 1"</English>
<Lang3>"Тестовое сообщение1"</Lang3>
<English>"Test Message 2"</English>
<Lang3>"Тестовое сообщение2"</Lang3>
<English>"Test Message 3"</English>
<Lang3>"Тестовое сообщение3"</Lang3>
Edited by LaCastiglione
Link to comment
Share on other sites

I usually use an array populated with default language (spanish in my case), and when launching script, check existence of an external lang file: if so, replace array values with file values (can be based on parameters or so). Of course, script doesn't uses strings directly, it uses array elements.

Link to comment
Share on other sites

why don't you to create your own header file which will contain all the details of the GUI based on the language? For example, your UDF should have the functions with Language title inside that you decalare whatever wnats

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...