Jump to content

Best way to create multi-language program?


Chetwood
 Share

Recommended Posts

I'm almost finished translating DVD Shrink to German which also means that I have to rewrite my MultiShrink tool since it is expecting english window titles like 'Backup complete' which naturally won't show up in the German version. While at it I also plan on translating the MultiShrik GUI to German and I'm thinking about which way to go here.

Since it's a really small program with only a few options I think using resource files would be over the top especially as I don't expect any requests for releases for languages other than English and German. Still I would prefer this over using the same routines twice in the script with one for each language like:

If $language = english
 If WinExists("Backup Complete", "")
 Do stuff
 EndIf
EndIf

If $language = german
 If WinExists("Backup fertiggestellt", "")
 Do stuff
 EndIf
EndIf

but do it similar to this:

If WinExists(rc_title_backupdone, "")
Do stuff
Endif

where as the 'rc_title_backupdone' is a line in the resource file that reads the corresponding window title.

Any suggestions on how to code something like this efficiently?

MultiMakeMKV: batch processing for MakeMKV (Win)MultiShrink: batch processing for DVD ShrinkOffizieller Übersetzer von DVD Shrink deutsch
Link to comment
Share on other sites

I'm almost finished translating DVD Shrink to German which also means that I have to rewrite my MultiShrink tool since it is expecting english window titles like 'Backup complete' which naturally won't show up in the German version. While at it I also plan on translating the MultiShrik GUI to German and I'm thinking about which way to go here.

Since it's a really small program with only a few options I think using resource files would be over the top especially as I don't expect any requests for releases for languages other than English and German. Still I would prefer this over using the same routines twice in the script with one for each language like:

If $language = english
 If WinExists("Backup Complete", "")
 Do stuff
 EndIf
EndIf

If $language = german
 If WinExists("Backup fertiggestellt", "")
 Do stuff
 EndIf
EndIf

but do it similar to this:

If WinExists(rc_title_backupdone, "")
Do stuff
Endif

where as the 'rc_title_backupdone' is a line in the resource file that reads the corresponding window title.

Any suggestions on how to code something like this efficiently?

<{POST_SNAPBACK}>

Select
case  @oslang = "0409"
 $bak_complete="Backup Complete"
case @oslang= "0407"
  $bak_complete="Backup fertiggestellt"
EndSelect

If WinExists($bak_complete, "")
   Do stuff
Endif

is that OK? :lmao:

Link to comment
Share on other sites

Hi,

I've noticed that the @OSlang is not working on Multilangual Windows versions so beware..... :lmao:

Andre

Edit : Perhaps an bug ?

Edited by Andre
What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to comment
Share on other sites

Hi,

I've noticed that the @OSlang is not working on Multilangual Windows versions so beware..... o:)

Andre

Edit : Perhaps an bug ?

<{POST_SNAPBACK}>

@OSLANG is the language os the Install Windows as opposed to what you can need in a Multilangual which is at user level.

I is not a bug but I understand you can need another macro to handle Multilangual environment. :lmao:

I have no idea how to implement your request.

Link to comment
Share on other sites

I don't want it to be OS dependent but user-dependent. It's quite possible someone is running both DVD Shrink and MultiShrink in German on an OS set to English. So it's not the problem to automatically detect the OS but to have efficient code so that nothing is done twice.

MultiMakeMKV: batch processing for MakeMKV (Win)MultiShrink: batch processing for DVD ShrinkOffizieller Übersetzer von DVD Shrink deutsch
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...