Localizing menus

Eric Chatonet eric.chatonet at sosmartsoftware.com
Mon Jan 28 12:39:43 EST 2008


Bonjour Damien,

MenuHistory seems, at first sight the straight way but, actually, it  
is 'hardcoded' as would be 'Cut' or 'Paste':
This means that you can't modify your menus, inverting two menu items  
or adding a new one, for instance without modifying your code.
It's the reason why I suggested the lineoffset approach:  the code  
will adjust itself to any modification :-)

To be more precise, I am used to keep not only menus but hundreds of  
strings in several Roman languages to set an interface.
I keep them in a ciphered external file (actually a simple tab tab  
return table, the first column of which is an ID) and load into a  
global this first column and the column that corresponds to the  
chosen language.
Then a function can return easily the right string in the right  
language according to an ID reference.

Le 28 janv. 08 à 18:18, GIRARD Damien a écrit :

> Mark Smith a écrit :
>> I've got this little freeware app for backing up files from an  
>> iPod, and one of my french users has asked about localizing it.
>> I've read through the past threads on the list, and I've got a  
>> decent custom property scheme working for all the bits and pieces  
>> in the UI.
>> However, I'm wondering about the menus - this is on OS X.
>>
>> Take the 'Edit' menu. Setting the label of btn "Edit" to  
>> "Édition" (extracted from my cp set) at start up is no problem,  
>> but then I need to replace the menuItems "Cut, Copy, Paste" with  
>> their localized counterparts, and also respond to the menuPick  
>> messages for each. This seems quote complicated. Has anyone some  
>> advice they can give me?
>>
>> Also, if anyone has the time, ability and inclination to help with  
>> translating the 20 words and phrases used into any other languages  
>> that would be amazing.
>>
>> Thanks,
>>
>> Mark_______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>>
> Hello Mark,
>
> In order to translate a menu, you have to work with "menuhistory".
> This function will return to you the position in the menu of the  
> entry selected.
>
> This is the script that I ever use in my translated menu.
>
> on menupick
> switch (the menuhistory of me)
> case 1
> -- script of the first menu entry.
> break
> case 2
> -- script for the second menu entry
> break
> end switch
> end menupick
>
> Note: About the menuhistory, line delimiter are considered like  
> menu item.
> Example:
> Cut      --> 1
> Copy   --> 2
> Paste   --> 3
> (-         --> 4
> Preference --> 5
>
> --------------------
>
> I am French, I can try to translate you some sentence from English  
> to French.
>
> Regards,
>
> GIRARD Damien
> Dam-pro
> www.dam-pro.com


Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list