How important is localised language strings
Agree with Barney; don't make it automatic.
In my case my applications search a given folder for any language file and uses the first one it encounters (unless the user overrides this and specifically insists on a particular language file). If none are encountered it unpacks a default language from the exe itself (English) and uses that. All very simple once you get used to it and the code is similar to that posted by Freak.
I think though for anything other than the smallest applications, do not consider piling all of your language strings into a data section; use external files for all but the default language.
In my case my applications search a given folder for any language file and uses the first one it encounters (unless the user overrides this and specifically insists on a particular language file). If none are encountered it unpacks a default language from the exe itself (English) and uses that. All very simple once you get used to it and the code is similar to that posted by Freak.
I think though for anything other than the smallest applications, do not consider piling all of your language strings into a data section; use external files for all but the default language.
I may look like a mule, but I'm not a complete ass.
PureDataConverter make use of the code from freak. English language and help included in the exe if missing
any language. For language i examine the directory, so you can add your
own language. Changing is on the fly. It's easy to implement
any language. For language i examine the directory, so you can add your
own language. Changing is on the fly. It's easy to implement
Last edited by ts-soft on Thu Jan 29, 2009 2:10 pm, edited 1 time in total.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

- utopiomania
- Addict
- Posts: 1655
- Joined: Tue May 10, 2005 10:00 pm
- Location: Norway
I agree with your views on automatic language selection and about storing the strings in separate files.
I'll have to think about rewriting that.
So far It handles english, norvegian, german and french.
USCode asks: What would be the order of importance, by language? Any thoughts?
I'm not shure what countries but have a list:
Japan, Italy, Russia, Spain, Poland, Netherlands, Belgium, Portugal, Sweden, Denmark, Finland and Iceland
in addition to the four already included.
Hope google translate can handle them all.
I'll have to think about rewriting that.
So far It handles english, norvegian, german and french.
USCode asks: What would be the order of importance, by language? Any thoughts?
I'm not shure what countries but have a list:
Japan, Italy, Russia, Spain, Poland, Netherlands, Belgium, Portugal, Sweden, Denmark, Finland and Iceland
in addition to the four already included.
Hope google translate can handle them all.

another +1 on don't make it automatic
(even though you already got the point)
On my system the app would default to japanese, I would prefer the app in english. The reverse situation is probably more common though.
Nero does this very badly...still
Pop up at install (or first run) for language, if possible have an easy way of changing it later too without reinstalling. The default display of the popup language and the highlighted language in the list can match the default of the system just to make the most common case the quickest to choose (single click and you are done).

On my system the app would default to japanese, I would prefer the app in english. The reverse situation is probably more common though.
Nero does this very badly...still
Pop up at install (or first run) for language, if possible have an easy way of changing it later too without reinstalling. The default display of the popup language and the highlighted language in the list can match the default of the system just to make the most common case the quickest to choose (single click and you are done).
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
- utopiomania
- Addict
- Posts: 1655
- Joined: Tue May 10, 2005 10:00 pm
- Location: Norway
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
The next most visited page in my website is the "language pack" page, so I guess there is a demand for it actually. At least for those damn Germans, haha
(no offense meant)
But myself I am actually more used to the English language now, I actually change some applications from Norwegian back to English, haha.

But myself I am actually more used to the English language now, I actually change some applications from Norwegian back to English, haha.
I like logic, hence I dislike humans but love computers.
That's a good practical solution, especially when one doesn't have a cluecase wrote: external localisation files are better as they can be made by users, so you don't have to care about making them yourself. and that can save your money from traductors.
about other languages.
If only we could to get the users to write the program for us too!

- utopiomania
- Addict
- Posts: 1655
- Joined: Tue May 10, 2005 10:00 pm
- Location: Norway
Thanks for the input!
A quick question to those of you that has done this before, what would this call look like in your localised apps.
As you can see I use a lookup function. What do you do?
A quick question to those of you that has done this before, what would this call look like in your localised apps.
As you can see I use a lookup function. What do you do?
Code: Select all
openWindow(#WIN, 0, 0, winW, winH, t("Window Title"), $CA0001)
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
I use this method. (see below)utopiomania wrote:Thanks for the input!
A quick question to those of you that has done this before, what would this call look like in your localised apps.
As you can see I use a lookup function. What do you do?
Code: Select all
openWindow(#WIN, 0, 0, winW, winH, t("Window Title"), $CA0001)
Then I have a "language loading procedure" which can load any language-file into that array replacing the "inbuilt language".
I also have "help tools" which does most of the work for me when making the constant list and the language array, what that tool does is that it parses the lines in a text file and outputs the needed code for me to past into my project (the enumeration list etc..).
Code: Select all
Enumeration ;Language
#L_File
#L_Update_channel_list
#L_Media_links
#L_Exit
#L_Search
#L_Search___
;etc...
;- Inbuilt language
L(0) = "File"
L(1) = "Update channel list"
L(2) = "Media links"
L(3) = "Exit"
L(4) = "Search"
L(5) = "Search "
;etc...
;example code...
If MessageRequester(L(#L_Update_check),L(#L_New_version_available)+#LF$+L(#L_Version)+": "+StringField(File,1,"|")+#LF$+L(#L_Update_now),#MB_ICONQUESTION|#PB_MessageRequester_YesNo) = #PB_MessageRequester_Yes
If DownloadFileWindow(Val(StringField(File,3,"|")),UpdateServer+"Internet%20TV.exe","Update.exe")
MessageRequester(L(#L_Done),L(#L_Update_successfylly_downloaded_program_will_restart_now),#MB_ICONINFORMATION)
RunProgram("Update.exe","update "+#DQUOTE$+ProgramFilename()+#DQUOTE$,"")
End
EndIf
EndIf
I like logic, hence I dislike humans but love computers.
idle wrote:That's a good practical solution, especially when one doesn't have a cluecase wrote: external localisation files are better as they can be made by users, so you don't have to care about making them yourself. and that can save your money from traductors.
about other languages.
If only we could to get the users to write the program for us too!

You know, this would be a good PBOSL thing (if it doesn't already exist). It doesn't need to be a lib or even PB code, just a resource file or ini file (or a little sqlite db file) or something that has the languages in there and everyone from the forums can add to it. All the common ones can be added in all the languages that we know (file, edit, copy, paste etc etc).
Then when anyone wants to use it they can just go grab the latest file, in return for usage, if someone needs to add any extras for their app they just add them to the main file too for everyone. (same with an extra language).
We have some sample code for how to use it but if it's a generic list (even CSV) then people can use it however they like.
worthwhile? (sorry if this is a thread highjack

I can commit to adding the Japanese.
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Theres some resources here too
http://wiki.powergui.org/index.php/Localization_wiki
http://wiki.powergui.org/index.php/Localization_wiki
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
- utopiomania
- Addict
- Posts: 1655
- Joined: Tue May 10, 2005 10:00 pm
- Location: Norway
Thanks for the info, Joakim!
I've been thinking about this language selection thing... I can get rid of the 'initial text in what language problem' if I present the user with an
install and/or first-run dialog with flag icons to click on, and maybe a simple 'select language' message in all supported languages..
I think this should be quite bulletproof, but a bit childish perhaps.
I'm not shure about this. I still think automatic selection will be ok for most people..
I've been thinking about this language selection thing... I can get rid of the 'initial text in what language problem' if I present the user with an
install and/or first-run dialog with flag icons to click on, and maybe a simple 'select language' message in all supported languages..
I think this should be quite bulletproof, but a bit childish perhaps.
I'm not shure about this. I still think automatic selection will be ok for most people..
