|
[
Permalink
| « Hide
]
Jonny Wray added a comment - 10/Dec/07 11:11 PM
The patch enclosed implements a platform independent method of specifying shortcuts by using the string 'shortcut' within the messages.properties file. The standard messages.properties has been altered to use shortcut instead of ctrl for the various common commands (new, save, etc). On MacOS this means command is used as the shortcut modifier, as is usual, whereas on windows it is ctrl. Other platforms will use their specific shortcut modifier, but only windows and macos have been tested.
don't we have to take this a step further and take i18n to a higher level?
I mean something like this: <bundle name>[_<locale>][_<platform>].properties, where platform is 'win', 'osx' or 'linux' (splitting linux into kde and gnome if needed) This would allow for complete localization of accelerators: for example on windows the common accelerator to exit an application is Ctrl-X, while on OSX its Command-Q This means translation of 'shortcut' to ctrl for Windows and meta for OSX is not enough. I remember seeing something like this on a blog a while ago, but I don't seem to be able to find it. Peter,
I see what you mean, this solution isn't complete. That said, it's better than the current situation and may suffice for some people. It certainly did on my current project which is why I made the changes. I'm planning on looking into solutions for Mac specific commands (ie quit being in the apple menu) over the next few weeks so at the same time I'll look into a more complete solution for this problem also. Jonny I've added a second patch that adds variant i18n to the previously described solution. So, this provides:
The same result could be achieved without the introduction of the shortcut modifier or the use of the ResourceBundleMessageSource extension. However, that solution would require a much larger number of properties files many with much the same content, violating DRY principles. |
|||||||||||||||||||||||||||||||||||||||||||||||