Localisation woes...Mac Os X Menubars

Malte Brill malte.brill at t-online.de
Sat Sep 27 05:56:01 EDT 2003


Hi List,

I´m working on version 1.1 of my small app. uGrabIt.
I came across some trouble, so I thought it might be helpful to post how I
coded around some parts of it and I also got a question.

This new version of my program will be also available geman and I thought
it´ll be a good idea to keep it expandable for other languages.

Regarding the tip posted by Thierry a few days ago I thought it is a good
idea to store all the localized Texts in an xxxxx.lproj folder in the
resources folder of my app. Everything works out fine until it comes to
menubars...

Problem number 1: Menuhistory is not working with the "about" menu.

I had a handler like this:

on menupick which
  if the menuhistory of me=1 then
    --my stuff here
  end if
  if the menuhistory of me=2 then
    --my other stuff here
  end if
  put which, the menuhistory of me
end menuPick

The menuhistory returned 1 for both "about" and the 2nd entry of my
menubutton.
So I coded around it:

on menupick which
  repeat with i=1 to the number of lines of me
    if line i of me=which then
      put i into lHasPicked
      exit repeat
    end if
  switch lHasPicked
    case 1
      --mystuff here
    break
    case 2
      --my other stuff here
    break
  end switch
end menupick

So after I got this working I placed two folders in the resources folder of
my app.

english.lproj
german.lproj

And tadaaaa! The system dialogues all appear in english instead of german.

help stays help instead of Hilfe

I removed the english.lproj folder and my dialogues show up in german.
For some testing I placed a french.lproj folder in.
The system dialogues show up in french instead of german.
When I move the english.lproj folder back in, it turns english again.

So here´s my guess. the Os looks at all .lproj folders that are in the
resources folder.
It grabs the first one it can find (in alphabetical order) and sets the
system dialogues to the language specified by the name of that folder...

Now how can I get the correct system Dialogue languages to work looking at
the Users language?

Any ideas?

Regards,

Malte




More information about the use-livecode mailing list