Access Application Translator (1 Viewer)

isladogs

MVP / VIP
Local time
Today, 01:29
Joined
Jan 14, 2017
Messages
18,186
Following on from my Translate & Speak app, this is a brief introduction to my soon to be released Access Application Translator utility.

It is designed to translate all form & report captions (labels/command buttons/toggle buttons/tab controls/option groups & navigation buttons) to another specified language.

The utility is intended for developers who create applications for clients in different countries and with varying native languages.

The attached example file is a zipped ACCDE file so, at the moment, it can only be used with forms & reports within the application.
However, it will shortly be released as an Access add-in so it can easily be used with a variety of Access applications.

I've also done a short video (no sound) to demonstrate it in use


Any comments/suggestions, please send me a PM or email
 

Attachments

  • AppTranslator_v1.2_32-bit.zip
    351.5 KB · Views: 551
  • AppTranslator_v1.2_64-bit.zip
    336.6 KB · Views: 604
Last edited:

cheekybuddha

AWF VIP
Local time
Today, 01:29
Joined
Jul 21, 2014
Messages
2,237
How accurately does it translate a translated app back in to English?

Or via a round of a few different languages? I'm curious about the Chinese Whispers effect of these translation services!
 

CJ_London

Super Moderator
Staff member
Local time
Today, 01:29
Joined
Feb 19, 2013
Messages
16,553
does it cover vba generated forms such as msgbox and inputbox? - I have a function which you call which will translate the message and then display in a msgbox/inputbox.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:29
Joined
May 7, 2009
Messages
19,169
Following on from my Translate & Speak app
open the form/report in design view, hidden mode.
loop though each controls check if the control is label.
if label, replace the Caption with Translated text from the
internet. save the form/report back.
 

isladogs

MVP / VIP
Local time
Today, 01:29
Joined
Jan 14, 2017
Messages
18,186
In answer to the above

@cheekybuddha
It translates back to English perfectly but there's a reason for that.
You're correct in saying that translating language A to language B to C to D and back to A is likely to produce some nonsensical results especially if there are any languages involving non-Latin scripts in that process.
You can easily test doing multiple translations with the other app: Translate & Speak | Access World Forums (access-programmers.co.uk)

Anyway, for precisely that reason, all translations in this particular app are always done from the starting language (English) so it will revert perfectly. You can easily test it and see for yourself.

The only differences are that
1. Code is used to add spaces before camel case capitals in captions e.g. LastName becomes Last Name. This is done to ensure such captions do get translated. However I've ensured that captions with repeated capitals like DOB don't get additional spaces added.
2. Any ampersands in captions e.g. Keyboard shortcuts are removed for similar reasons so e.g. Post&Code becomes Post Code

@CJ_London
The current version doesn't translate message boxes or input boxes though its on my 'to do' list.
In less than 5 minutes, I've done that with an example of message box text but translating the message box buttons might be a challenge:

1633689328572.png

I'd be interested in seeing that function of yours....especially if it can translate the message box button text (without altering the default language on the workstation!)

@arnelgp
Yes of course that's precisely how this app works except that it translates captions in all control types which have them...not just labels.
However the app automates the process for convenience and makes it very fast
 
Last edited:

CJ_London

Super Moderator
Staff member
Local time
Today, 01:29
Joined
Feb 19, 2013
Messages
16,553
mine doesn't translate the buttons - my assumption is when distributing a .accde front end to users around the world their wondows will be in the language of their choice. So on first open, if the app detects the language of the user is not English it gives the user a choice of staying with English or converting to their local language. In which case the buttons would be translated by windows.

If you are doing message translations 'live' at the time of display then should not be a problem - so can it cope with a message something like

'Customer XYZ Ltd has requested a sample of our minimouse product'

where the message string is concatenating customer and product names.

Not forgetting you may have dynamic captions and textbox content as well.

Not sure how your app works, but I fetch the translations as a one time exercise and store in a table. When a form opens, the captions are converted at that time.

One other thing I deal with is I might have a caption 'customer', but the user may prefer 'clients' or 'supplier' v 'provider'. So even English users can still 'translate'.
 

Gasman

Enthusiastic Amateur
Local time
Today, 01:29
Joined
Sep 21, 2011
Messages
14,048
I was going to say that the buttons would automatically be in the user's own language, wouldn't they?
 

isladogs

MVP / VIP
Local time
Today, 01:29
Joined
Jan 14, 2017
Messages
18,186
@CJ_London
The simple example I gave included dynamic content with both concatenation and variables.

I use the FormattedNMsgBox function where the first section of the message is in bold.
That means there are three strings in the message: Bold text (s1), normal text (s2) & title (s3)

Code:
Private Sub cmdSave_Click()
    'saves current language as default
  
    Dim s1 As String, s2 As String, s3 As String
  
    s1 = Translate("This will save the form in its current language: " & strLanguage, strOldLang, strLang)
    s2 = Translate("Are you SURE you want to do this?               ", strOldLang, strLang)
    s3 = Translate("Save form in " & strLanguage & "?", strOldLang, strLang)
    
    If FormattedMsgBox("" & s1 & "" & "            " & _
        "@" & s2 & "@", vbQuestion + vbYesNo + vbDefaultButton2, "" & s3 & "") = vbYes Then
                AppendNewLangDbObjectCaptions (intObjID)
    End If

End Sub

With a standard message box, there would just be two strings to translate: message text & title text

Sounds like we are using the same approach.
In my app, the captions are also saved to a table in both the original language and the translated language(s).
A default language is also set and the captions for that language are loaded automatically

1633711988251.png


NOTE: the label lblMDS is deliberately excluded from the code so it is left untranslated!
As for the final point you made, I include items like that in a separate Settings table so program admins can modify as appropriate

@Gasman
The button text will of course be automatically updated to match the users default language. The only reason I mentioned it was so I could easily view the results myself without changing the Windows default language settings
 
Last edited:

Sun_Force

Active member
Local time
Today, 10:29
Joined
Aug 29, 2020
Messages
396
1- Is these errors normal?

2021-10-09_03-26-20.jpg


2021-10-09_03-27-30.jpg


2- I think the font and its size should be changed after translating. After translating, the text in some languages is horrible;

2021-10-09_03-29-31.jpg


3- I think adding a scroll bar to the text can help. The length of the text after translating is different and in some cases the last part is not visible:

2021-10-09_03-31-13.jpg


4- Normally the name of the language is written in that language. It's because if I'm Korean and I can't read English, I can not find the language I want. Most application's language selection is offered as following:

2021-10-09_03-32-16.jpg
 

isladogs

MVP / VIP
Local time
Today, 01:29
Joined
Jan 14, 2017
Messages
18,186
Hi @Sun_Force
Thank you for your feedback which is much appreciated.
I did say it was pre-release. Bugs are to be expected at this stage

1- Is these errors normal?
NO! Sorry. that doesn't occur in the ACCDB version. If you watch the video you'll see no errors occur.
However, I got a similar error in the ACCDE.
The error occurs because code is used to open the form being translated in design view - which of course is not possible in an ACCDE.
OOPS!
The release version will be an ACCDB add-in so the issue won't arise.

However you should have no problems translating the Start form to other languages

2- I think the font and its size should be changed after translating. After translating, the text in some languages is horrible;
The font looks different on my computer. Its much smaller than in your screenshot
Perhaps you have a different default setting?
1633720047948.png


3- I think adding a scroll bar to the text can help. The length of the text after translating is different and in some cases the last part is not visible:
Agreed - its on the list of things to do.
However I can't replicate the screenshot you have for point 3.
It looks like Cryllic script but I'm not sure which language you have in that screenshot. Can you let me know please
This is Belarusian. Notice that the text is again much smaller than in your screenshot and it all fits with plenty of room to spare...
1633720852421.png


4- Normally the name of the language is written in that language. It's because if I'm Korean and I can't read English, I can not find the language I want. Most application's language selection is offered as following:
I'd already considered that point
At the moment the app is designed for the purpose of translating from English as the original language.
I'm intending to expand that to any language that is based on a Latin script.
Unfortunately that doesn't include Korean.
That limitation is to do with how certain VBA code handles (or rather fails to handle) non-Latin script such as Korean.

1633721877194.png


Unfortunately, that issue is something that I cannot overcome - it is nothing to do with my code as such.

For that reason, I NEVER translates e.g. English => Korean => Japanese => French in this app ... and nor does Google Translate.
Instead, Latin script languages such as English are often used for conversion

However, I think I should be able to translate the combo dropdown lists to match user's chosen language.
I'll look into that
 
Last edited:

CJ_London

Super Moderator
Staff member
Local time
Today, 01:29
Joined
Feb 19, 2013
Messages
16,553
Slight difference in approach- I store the phrase and translation rather than the form and control details - how many times will the phrase ‘customer name’ be used in different forms and reports?
 

Sun_Force

Active member
Local time
Today, 10:29
Joined
Aug 29, 2020
Messages
396
The font looks different on my computer. Its much smaller than in your screenshot
Perhaps you have a different default setting?
Where should I look into? I mean where is this default settings? Access default settings or Windows' ?

Agreed - its on the list of things to do.
However I can't replicate the screenshot you have for point 3.
It looks like Cryllic script but I'm not sure which language you have in that screenshot. Can you let me know please
It is Bulgarian.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 01:29
Joined
Feb 19, 2013
Messages
16,553
One other consideration you may have to make is the destination language may have a longer phrase than the English equivalent requiring either resizing the control or modifying the font size

For example

hello world

translates to French as

Salut tout le monde
 

isladogs

MVP / VIP
Local time
Today, 01:29
Joined
Jan 14, 2017
Messages
18,186
Where should I look into? I mean where is this default settings? Access default settings or Windows' ?

It is Bulgarian.
I'm not sure what settings are different on your computer
This is how it looks for me using Bulgarian

1633736709630.png


As you can see ...it all appears to fit.

One other consideration you may have to make is the destination language may have a longer phrase than the English equivalent requiring either resizing the control or modifying the font size

That was taken into account from the start. For example, the buttons are far longer than is necessary for the English captions

I'm currently working on an efficient way of translating all 109 languages into the default language used for Windows on a user workstation.
Here are the first few languages in English, French & Korean. The translation works ... but it takes several seconds to complete
1633737888368.png

Hopefully @Sun_Force will be able to vouch for the accuracy of the Korean translation as I can't read it!
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:29
Joined
May 7, 2009
Messages
19,169
For that reason, I NEVER translates e.g. English => Korean => Japanese => French in this app ... and nor does Google Translate.
Instead, Latin script languages such as English are often used for conversion
translator is but an AI.
it does not really know to "pick" the right word.
nor does it know the correct grammar.
it is but suggesting.
It is designed to translate all form & report captions (labels/command buttons/toggle buttons/tab controls/option groups & navigation buttons) to another specified language.
from the first statement above, it means if you are korean or chinese you need to install english first and do the Captioning in english.
so if you are not well versed in English, sorry for you, you go and enroll to English class first.
 

Sun_Force

Active member
Local time
Today, 10:29
Joined
Aug 29, 2020
Messages
396
Hopefully @Sun_Force will be able to vouch for the accuracy of the Korean translation as I can't read it!
The accuracy is fair enough. But I'm really better in Japanese & Chinese.
I tested all three languages on the first form that opens and it was excellent.
 

isladogs

MVP / VIP
Local time
Today, 01:29
Joined
Jan 14, 2017
Messages
18,186
@arnelgp
Perhaps you should have checked more thoroughly before criticising

translator is but an AI.
it does not really know to "pick" the right word.
nor does it know the correct grammar.
it is but suggesting.

Yes of course Google Translate uses AI based on rules to try and make it as accurate as possible.
This quote is from Google Translate - Wikipedia
Google Translate does not translate from one language to another (L1 → L2). Instead, it often translates first to English and then to the target language (L1 → EN → L2).[73][74][75][5][76] However, because English, like all human languages, is ambiguous and depends on context, this can cause translation errors. For example, translating vous from French to Russian gives vous → you → ты OR Bы/вы.[77] If Google were using an unambiguous, artificial language as the intermediary, it would be vous → you → Bы/вы OR tu → thou → ты. Such a suffixing of words disambiguates their different meanings. Hence, publishing in English, using unambiguous words, providing context, using expressions such as "you all" often make a better one-step translation.

The following languages do not have a direct Google translation to or from English. These languages are translated through the indicated intermediate language (which in most cases is closely related to the desired language but more widely spoken) in addition to through English:[citation needed]


My apps are also using English as an intermediary for the same reasons. The results won't be perfect but the errors are likely to be reduced
from the first statement above, it means if you are korean or chinese you need to install english first and do the Captioning in english.
so if you are not well versed in English, sorry for you, you go and enroll to English class first.
I agree with some of that. Ideally a translation service should be able to translate from any one language to any other.
If both languages use the same script, this works well.

Problems often occur when the source language uses a non-Latin script. This can easily be seen by translating e.g. English => Korean => English

Lets take a simple En=>Ko example using my Translate & Speak app
En2Ko_T&S.PNG


Now I'll do the same in reverse. I've not used the Swop button but have started again by entering the Korean text from scratch

Ko2En_T&S.PNG

The end result isn't identical to the original but it really isn't at all bad

Now I'll do exactly the same conversion but using your own Translate app which uses slightly different code

1633799916846.png


Now I'll do the same in reverse using your app:

1633800058579.png


As you can see, the end result bears no resemblance to the original text. In fact, its nonsense.
As a courtesy to you, I explained the reasons why your app fails on translating from non-Latin scripts in this post: Language Translator | Page 2 | Access World Forums (access-programmers.co.uk)

It is for that reason that my initial version always used English as a source language but I hope to address that later

I agree there are ways my own app can be improved & I intend to address some of those before the final version is released as an Access add-in. I do welcome constructive comments but your feedback on anything I upload always comes across as completely negative

If you have nothing constructive to say, then say nothing
 

Users who are viewing this thread

Top Bottom