Results 1 to 29 of 29

Thread: Translator

  1. #1

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Translator

    I've created a translator that would be very handy to create TXT with different languages to translate the UI of each app. As you can see from the picture, you can get the version of each key and a little tooltip that would explain what does that key means (clik to enlarge the image)



    I would like to receive any feedback regarding this. The translator can be downloaded from file that's uploaded on the site (1.82 MB) .

    I would seize this opportunity to say that if anyone is interested in translating MP3 Organizer's UI into any language, I'd be glad to have it sent to me (different from English and Spanish, 'cos I've already done them). However, if you find the size of the Translator's setup is to big... you can also download the lastest English file (3.25 KB) and translate it using any text editor.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  2. #2

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    no comments?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  3. #3
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    it looks good... but it's as hard to look through as the Registry
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  4. #4

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    What do you mean with "hard to look through"? Would you change anything? The idea is to make it "universal" so that anyone could use it for his/her app.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  5. #5
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    it's just me.....
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  6. #6

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Any other comments?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  7. #7
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819
    So you're saying that I can create my app in English and then start up your app and convert it to Spanish, for example?

  8. #8

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Yes... but you have to bear in mind that it's an INI what you're creating. So, you have to translate each caption as it says in the INI file. This app would be to create the INI file easily, with a graphical interface an some "tips" that the INI itself won't show (such as the tooltip for each key or the version where it was released)

    In other words... you'll be able to translate but you will have to load the caption of all your control. This is the code I'm using:

    (in a module)
    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function GetPrivateProfileString Lib "kernel32" Alias _
    4.   "GetPrivateProfileStringA" (ByVal lpApplicationname As String, _
    5.   ByVal lpKeyName As String, ByVal lpDefault As String, _
    6.   ByVal lpReturnedString As String, ByVal nSize As Long, _
    7.   ByVal lpFileName As String) As Long
    8. Public IniFile As String
    9.  
    10. Public Function GetCaption(AppName As String, KeyName As String, _
    11.    Default As String)
    12.     GetCaption = GetIniStr(AppName, KeyName, Default)
    13.     GetCaption = Trim(GetCaption)
    14. End Function
    15.  
    16. Private Function GetIniStr(lpAppName As String, lpKeyName As String, _
    17.   lpDefault As String)
    18.     Dim ret As Long
    19.     Dim Temp As String * 200
    20.     Dim lpFileName As String
    21.    
    22.     lpFileName = IniFile
    23.     ret = GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, Temp, _
    24.       Len(Temp), lpFileName)
    25.     If ret <> 0 Then
    26.         GetIniStr = Trim0(Temp)
    27.     End If
    28. End Function
    29.  
    30. Private Function Trim0(Word As String)
    31.     Dim i As Integer
    32.    
    33.     For i = Len(Word) To 1 Step -1
    34.         If Asc(Mid$(Word, i, 1)) <> 0 Then Exit For
    35.     Next i
    36.     Trim0 = Left$(Word, i)
    37.  
    38. End Function
    Usage
    VB Code:
    1. cmdOK.Caption = GetCaption("Preferences", "OkButton", cmdOK.Caption)

    You should also bear in mind that you need to set the IniFile variable with the file you want to get info from.

    One thing that should be more flexible is the extension of the file (since MOF might not be the extension you'd like for your program). Also, correct the error that (I guess) it would be raised if a commented line was between the keys (not at the top of the INI file)
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  9. #9

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    After re-reading your question... I guess the answer is "No". Or at least... no, not that easily (the answer is in the previous post)
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  10. #10

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Any other comment? Do you think anyone would be interested?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  11. #11
    Frenzied Member dis1411's Avatar
    Join Date
    Mar 2001
    Posts
    1,048
    still dunno what the feck its supposed to do
    but im using xp and cant see what the status bar in the lower right corner says... also if u take the lower right corner and resize the window by going all the way to the top left, the prog promtly freezes

  12. #12

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    It's an interface to let you translate your INI files into other languages.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  13. #13
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    I'd be interested in it. Can your program analyze and determine the controls withing the program? (Can't tell much form the screenshot)
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  14. #14
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Pearl Jam:
    'he can't see, so he chases them away...'
    You see McBain, you have by blind luck stumbled onto something probably far more useful than a MP3 Organizer..

  15. #15
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    If you open up any form such as below in Wordpad or Notepad, if you edit caption property and save it, the caption has permenantly changed, and will show that when you open the project through Visual Basic.

    Therefore, it is possible to write a scanner to change captions, whether they are button captions, labels, etc, on all your forms to a different language..
    VB Code:
    1. VERSION 5.00
    2. Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
    3. Begin VB.Form Form1
    4. Begin VB.Label NOfficeLabel
    5.       BackColor       =   &H80000004&
    6.       [b]Caption         =   "Next Office Visit"[/b]
    7.       BeginProperty Font
    8.          Name            =   "Times New Roman"
    9.          Size            =   14.25
    10.          Charset         =   0
    11.          Weight          =   400
    12.          Underline       =   0   'False
    13.          Italic          =   0   'False
    14.          Strikethrough   =   0   'False
    15.       EndProperty
    16.       Height          =   255
    17.       Left            =   1320
    18.       TabIndex        =   20
    19.       Top             =   1680
    20.       Width           =   1935
    21.    End
    Last edited by nemaroller; Jul 13th, 2002 at 08:18 AM.

  16. #16
    Fanatic Member Geespot's Avatar
    Join Date
    Oct 2001
    Location
    Birmingham, UK
    Posts
    577
    I think this is a cool idea, although i would have no use for it

    as far as i can tell it does this..


    you store all of your controls captions names into a INI file, then when your program starts up, you check the ini file and set the captions on your controls to what they are in that ini file

    and that program above allows you to change the language of the text that is stored in the INI file.

    So next time your program starts up, it reads in the captions and will be a differnt language

    am i right?

    if so i like the idea but as i said above, i have no use for one

  17. #17

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Originally posted by nemaroller
    VB Code:
    1. VERSION 5.00
    2. Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
    3. Begin VB.Form Form1
    4. Begin VB.Label NOfficeLabel
    5.       BackColor       =   &H80000004&
    6.       [b]Caption         =   "Next Office Visit"<b>If you open up any form such as below in Wordpad or Notepad, if you edit caption property and save it, the caption has permenantly changed, and will show that when you open the project through Visual Basic.
    7.  
    8. Therefore, it is possible to write a scanner to change captions, whether they are button captions, labels, etc, on all your forms to a different language..
    9. </b>
    10.       BeginProperty Font
    11.          Name            =   "Times New Roman"
    12.          Size            =   14.25
    13.          Charset         =   0
    14.          Weight          =   400
    15.          Underline       =   0   'False
    16.          Italic          =   0   'False
    17.          Strikethrough   =   0   'False
    18.       EndProperty
    19.       Height          =   255
    20.       Left            =   1320
    21.       TabIndex        =   20
    22.       Top             =   1680
    23.       Width           =   1935
    24.    End
    [/B]
    Yes, but you have to re-compile and provide one EXE for each language you might upload (or distribute in any way). What I'm doing is getting the captions from an INI file so that you don't have to translate them by hand, and you can use one single EXE and dozens, or hundreds of translation files (which are merely text files which are very small)
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  18. #18

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Originally posted by Geespot
    I think this is a cool idea, although i would have no use for it

    as far as i can tell it does this..


    you store all of your controls captions names into a INI file, then when your program starts up, you check the ini file and set the captions on your controls to what they are in that ini file

    and that program above allows you to change the language of the text that is stored in the INI file.

    So next time your program starts up, it reads in the captions and will be a differnt language

    am i right?

    if so i like the idea but as i said above, i have no use for one
    You're almost right. It doesn't use the control's name. You can use the key you'd like, I mean, your control can be named Command1, and the INI's key could be cmdOk, anyway.

    I don't use controls key for one reason.... you may don't want to translate a control... what about a MsgBox, or an InputBox?... what about the tooltips for the controls?... what about the text that you may ocassionally show in the status bar?

    I guess you got the idea. You can name the keys in the INI as their controls, but you will still have to code the read-the-text-from-the-INI for each control's caption, tooltip, msgbox.... whatever.

    Am I clear?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  19. #19

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Originally posted by dis1411
    also if u take the lower right corner and resize the window by going all the way to the top left, the prog promtly freezes
    Not anymore...
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  20. #20
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Re: Re: Well

    Originally posted by Mc Brain
    No it can't. Anyway.... why would you like to do that? You have to code your forms so that the captions are changed, they won't change by magic. In that case, why would you want to get it scanned??
    I just thought it would be anneat idea to scan, provide a list of controls (buttons), and allow you to change the captions...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  21. #21
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827

    Re: Re: Re: Well

    Originally posted by James Stanich


    I just thought it would be anneat idea to scan, provide a list of controls (buttons), and allow you to change the captions...
    You mean scan through an exe file? If yes, then it'll probably only work for standard Windows controls or common controls because if you create a control and draw the text yourself, you won't be able to change the language from English to something else.
    ...or maybe I am thinking completely different stuff...
    Baaaaaaaaah

  22. #22
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Re: Re: Re: Re: Well

    Originally posted by abdul


    You mean scan through an exe file? If yes, then it'll probably only work for standard Windows controls or common controls because if you create a control and draw the text yourself, you won't be able to change the language from English to something else.
    ...or maybe I am thinking completely different stuff...
    What I meant was to build a list of buttons in the project (not exe).

    Then form this list, create sections (LANGUAGES) in the INI file.

    With a sinple Flag in the INI file, you could make the program read any text on the button captions (at least, that is what I was thinking)...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  23. #23
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    I believe he is trying to make a GUI to create the INI files to translate all the words into other words. I just used his code and made this (attached)
    <removed by admin>

  24. #24

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Pretty much... that's the idea. However, since there are so many key on a text file I'm creating a new file for each language with its key and its translation. The UI shows you the key to translate, a brief explanation what (or where or when) is that key shown and the version when it was released (this is useful so that if you have a language file which version is 1.6.5 you know you only have to translate the versions 1.6.6 on to update the language file to the last one.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  25. #25
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Suggestion :

    Add additional keys for the tooltips...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  26. #26

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    What do you mean?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  27. #27
    Hyperactive Member
    Join Date
    Jun 2002
    Posts
    299
    what languages does it do?

  28. #28
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Tooltips of the buttons...

    Explanation of what each button does....

    Question though, isn't this waht a resource file is meant for?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  29. #29

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: Well

    Ain't you following me at all?

    Originally posted by James Stanich
    Tooltips of the buttons...

    Explanation of what each button does....
    Originally posted by Mc Brain
    I don't use controls key for one reason.... you may don't want to translate a control... what about a MsgBox, or an InputBox?... what about the tooltips for the controls?... what about the text that you may ocassionally show in the status bar?
    I meant that you have to code any translation.... to translate Msgboxes, Tooltips, inputboxes, any kind of message... So, you a need one key for each "message" you want to get translated.

    Originally posted by James Stanich

    Question though, isn't this waht a resource file is meant for?
    As far as I know, you can create multiple EXEs just by changing the resource file (to another language). I don't want to create multiple EXEs. You downloaded the English version and now wanted to have in portuguese... translated yourself, or get someone to translate a TXT file (with any editor) and you're done!! The only goal for this UI is to help the translator (user) when translating each key.
    Last edited by Mc Brain; Jul 15th, 2002 at 12:13 PM.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width