Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Localize application

Status
Not open for further replies.

TorF

Programmer
Sep 30, 2002
83
FR
I made an application in US language under MS ACCESS.

I want to localize it in others languages (Japanese, Spanish, no limits in language..).
That implys modifying forms, some tables, VB code, ect...

Can you give me links or suggestions, that give differents solutions to make localization ?

Thanks
 
resource files (and a bit of patience). MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Yes i'm searching for something equivalent to resources in MFC project, in Access. (huhu that's not a joke... :/)

Example for forms, that is the most interresting and hard I think.

It is bad to have a copy of a form for each language... (it's seriously bad when updating code that imply modifying code in all forms,...)

Is there a solution to have only one form, that during loading change displayed strings according to current language ?

Or second possibility, first the creation of one form.
And then a process that wil automaticly duplicate the form, changing only text of controls...
(need a table convertion, ie US->Japanese)


If you already have the same problem, and can give with suggestions, idea or what is better to do...

Thanks
 
Hi

I have never done any localisation, so I cannot offer any (useful) advice, but on the question of forms (ie a form per language or a single form), surely the answer is a single form, with labels names, and a table to populate the label captions of form load. You have table keyed on (say) Language;FormName;LabelName which contains the relevant text in each language

That is the sum total of my knowledge on this subject, sorry Hope this helps

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Finaly I use the single form option with a language table to populate the label captions.

During form opening, I replace all label captions by corresponding sentences found in the language table.


It works as:

3 fields in language table : id , string and id_lang

All label captions contains something like $$$48$$$
48 corresponds to the id field in language table

First action when opening Form is to call the Localize function

'Replace for all controls the caption that correspond to syntax $$$xx$$$
Public sub Localize(byref Form as Form)
Dim Control As Object

Form.Caption = ConvertText(Form.Caption) 'Here replace form title
For Each Control In Form.Controls
Control.Caption = Localize_ConvertText(Control.Caption )
Next Control
End sub

'Return text found in language table, or return text if it don't correspond to the $$$xx$$$ syntax
Private Function Localize_ConvertText(ByRef text As String) As String
Dim IdString As Long

IdString = Localize_GetIdString(text) 'This function return the identificator xx in $$$xx$$$, and if syntax does not correspond it returns -1

If IdString = -1 Then
'it is not a $$$xx$$$ caption, keep the same text
Localize_ConvertText = text
Else
'return the corresponding string from the language table
'be sure to set IdLang to current language, according with the language table field id_lang
Localize_ConvertText = DFirst("string", "language_tbl", "id=" + CStr(IdString) + " AND id_lang="+cstr(IdLang))
End If
End Function

This works very well, really quick (i don't see difference with static labels). You can adopt this solution.

Next step is to set text that changes during form life, with various parameters....
 
Hi

Good to hear it worked for you Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top