database translation

benjamin.weizmann

Registered User.
Local time
Yesterday, 23:36
Joined
Aug 30, 2016
Messages
78
hi :)
I would like to know .. what is the best and creative way to add translation to other language (if the user chose it) to all database and its forms?

I thought something like floating massage when u stand something with the mouse..

I would like hear more ideas

thanks ")
Ben
 
you can make a table like this (pic1).
the columns 1133, 2054, are the LocaleID (languange ID).
on access you can find out the language ID by:


debug.Print application.LanguageSettings.LanguageID(msoLanguageIDInstall)


fill the table with pertinent labels (pic2).


now on the start of your db save the Langauge to Public variable.


Public gblLanguangeID As String



on each of the Form's or Report that open, inquire this table about the
correct translation.


Private Sub Form_Load
gblLanguageID = application.LanguageSettings.LanguageID(msoLanguageIDInstall) & ""

Me.Label1.Caption = RegionalText(Me.Name & ".Label1")
End Sub




in a Standard Module:


Public Function RegionalText(strObjName As String) As String
RegionalText = Nz(DLookup(gblLanguage, "TranslationTable","ObjName=" & Chr(34) & strObjName & Chr(34)), "")

'if there is no transation use English
If RegionalText="" Then _

RegionalText = Nz(DLookup("1033", "TranslationTable","ObjName=" & Chr(34) & strObjName & Chr(34)), "")
End function

 

Attachments

  • pic1.png
    pic1.png
    11.5 KB · Views: 102
  • pic2.png
    pic2.png
    10.8 KB · Views: 99
you can make a table like this (pic1).
the columns 1133, 2054, are the LocaleID (languange ID).
on access you can find out the language ID by:


debug.Print application.LanguageSettings.LanguageID(msoLanguageIDInstall)


fill the table with pertinent labels (pic2).


now on the start of your db save the Langauge to Public variable.


Public gblLanguangeID As String



on each of the Form's or Report that open, inquire this table about the
correct translation.


Private Sub Form_Load
gblLanguageID = application.LanguageSettings.LanguageID(msoLanguageIDInstall) & ""

Me.Label1.Caption = RegionalText(Me.Name & ".Label1")
End Sub




in a Standard Module:


Public Function RegionalText(strObjName As String) As String
RegionalText = Nz(DLookup(gblLanguage, "TranslationTable","ObjName=" & Chr(34) & strObjName & Chr(34)), "")

'if there is no transation use English
If RegionalText="" Then _

RegionalText = Nz(DLookup("1033", "TranslationTable","ObjName=" & Chr(34) & strObjName & Chr(34)), "")
End function


wow thanks u
I guess it will make my database so slow right?

Ben
 
only suggesting, you don't need to actually implement it, right?
 
Probably. Since this isn't something you probably need to support on the fly, why not create a process that YOU can run to change the captions and then save them. You would then distribute whichever FE a user needed.

You obviously don't want to hard code the caption changes. That will make a maintenance nightmare with two or more code bases. But you can keep a single master FE to which you make all changes and then when you are ready to distribute, create the translation by running your code.
 
For a full translation there are other considerations such as message and input boxes, possibly rowsources to list and combo boxes, captions to buttons and forms etc, captions for field names if using datasheets.

You also need to consider size - a word in English can be significantly longer in German for example, so can have an impact on control sizing and position.

With regards speed, assuming you have a translation table, it will not be that large so can be loaded to memory as a dictionary on opening of the app, then each form/report references the dictionary on opening to populate labels/captions etc. The user will not notice any drop in performance.

Point is there are other considerations, so if building a multilingual database, you really need to consider it from the beginning, not as an afterthought.
 

Users who are viewing this thread

Back
Top Bottom