other languages

gjoisa

Active Member
Licensed User
Longtime User
Hi everybody !
I am trying a program in our local language . I am from India and every state has its own language . Almost all PCs support local languages now a days . Can it be done ? Then how ? I am intending the coding in english and the output shuld be in local language .:sign0085:
 

Cableguy

Expert
Licensed User
Longtime User
Using the info on THIS THREAD, you can retrieve the code page that is being used by the system, and have the "normal" text converted to that codepage with THIS DLL....
Shouldn't be too hard...
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Using the info on THIS THREAD, you can retrieve the code page that is being used by the system, and have the "normal" text converted to that codepage with THIS DLL....
Shouldn't be too hard...
That is usually not required.
You can simply work in the language you like in the same way you work with English strings.
 

agraham

Expert
Licensed User
Longtime User
I assume that you want the same program to be available with ther option of different languages. You need to know that Pocket PCs are Unicode based, even the OS while on the desktop .NET is also Unicode even if the underlying OS is not. What this means is that you don't have to do any character code conversion as the Unicode character set includes all languages.

I would suggest that rather than keeping strings in the program they are read from a UTF8 format text file at runtime. You may need to extend this to the text in lables and on buttons etc.

You need to get the Unicode strings in the correct language in the UTF8 files. This can be a problem as keyboards are set to a specific language so that even a Unicode aware program, like Notepad in XP and Vista, can only easily generate files in the language that the system is set to. You may need to generate each file on a PC or device set to the appropriate language.

Naturally each device will need the system set to the required language to get the correct font for each language.
 

klaus

Expert
Licensed User
Longtime User
I can confirm that this works.

For the Expense Tracker program http://www.b4x.com/forum/share-your-creations/1316-expense-tracker.html, alfcen translated the texts used in the program for Labels, Buttons etc. from English to Japanese. Unfortunately on my PPC with a French operating system I didn't see the Japanese texts on controls managed by the operating system, even after loading a Japanese font set, but with the Japanese operating system alfcen confirmed that it looks great. There is only one program, and as agraham wrote, the texts are read at runtime.
http://www.b4x.com/forum/questions-help-needed/1449-font-change.html

In the screenshot in the first post you can see Japanese texts in the Labels and Checkboxes but not in the MessageBox.

Best regards
 

gjoisa

Active Member
Licensed User
Longtime User
Sorry for re entering the old thread . Actually I did not understand the language changing method and dropped the project at that time . Again trying now . Can any one describe the concept with a small example ? Thanks in advance .
 

klaus

Expert
Licensed User
Longtime User
There is an example here: http://www.b4x.com/forum/code-samples-tips/3701-some-modules.html

In the 'Setup' module you can select the language you want, not all languages are already translated. There are 2 text files for each language, one for general texts, common to all programs, and one for texts specific to the program where the module is used.

Best regards.
 

gjoisa

Active Member
Licensed User
Longtime User
Nothing understood by me . I dont know Japanese or French . I am trying to get "Kannada" (an Indian language) charecters in my application . MSDN's code page identifier refers identifier as 57008 and .Net name as x-iscii-ka for this language. How to use this char sets in my application ?
 

klaus

Expert
Licensed User
Longtime User
What language is your OS ?

In the Setup module you can select a language, the texts of the different controls and the texts in the code are stored in different text files for the languages and read into the program in an array. The texts are updated in the UpdateLanguage routines.
To create the text file, you should use a text editor with the right character set and probably the right keyboard.

The Japanese file in the example in the Setup module was written by alfcen a user in Japan. It works fine with a Japanese OS.

I had tried to get Japanese characters on my system for testing but without any success, the system messages still remain the original ones. The problem was discussed in this thread: http://www.b4x.com/forum/questions-help-needed/1449-font-change.html

Best regards.
 
Last edited:

agraham

Expert
Licensed User
Longtime User
As we said before Basic4ppc can already handle most characters. For instance even on my UK desktop this code will display a Kannada string in a text box.

B4X:
For i = 3218 To 3231
    msg = msg & Chr(i)
 Next
Textbox1.Text = msg
3218 to 32331 are part of the set of Unicode code points allocated to Kannada characters Kannada - Test for Unicode support in Web browsers To display the characters you need an appropriate font on the system, which it seems my desktop has although my devices have not.

You also need a source of the text that you want to display. It could be entered from a keyboard if the system keyboard settings support Kannada or it could come via a file genereated by some external means.
 

gjoisa

Active Member
Licensed User
Longtime User
Thank you Agraham . Almost I got it . The web page which you mentioned helped me lot . It contains exact ascii numbers . And my computer also have the fonts called "Tunga" and "shruti" work fine . i have copied and pasted the font in my device 'Windows/fonts' folder working fine with my device also . Thanks for clear explanation .
 
Top