Le 26/02/2014 à 23:13, Shane Stanley < email@hidden> a écrit : On 27 Feb 2014, at 2:39 am, koenig.yvan < email@hidden> wrote: To get rid of them I tested this alternate code :
set p2TextEdit to (path to applications folder as text) & "TextEdit.app"
set Overwrite_loc to localized string "Overwrite" in bundle file p2TextEdit
Is there some reason you didn't use:
set p2TextEdit to path to application "TextEdit" set Overwrite_loc to localized string "Overwrite" in bundle p2TextEdit
Hello Shane
I don't know if it's a good one but I really have one reason. Here I passed an example which everybody was able to test. In practice most often I use localized string to grab values from iWork applications (mainly Numbers to build formulas in the scripts). For them it's a bit more complicated because the source folder is not a fixed one.
If we use iWork applications bought as a single package (the original iWork '09 structure), the resources are in a bundle stored in the folder Macintosh HD:Library:Application Support:iWork '09:Frameworks: and the file is named : Localizable.strings from the framework SFTabular.frameworks among 20 frameworks)
If we use an iWork '09 application bought thru Mac App Store, the resources are in the folder Macintosh HD:Applications:iWork '09:Numbers.app:Contents:Frameworks: and the file is named : Localizable.strings from the framework SFTabular.frameworks among 20 frameworks)
If we use an iPlay '13 component the resources are in the folder : Macintosh HD:Applications:Numbers.app:Contents:Resources: and the file is named : TSCalculationEngine.strings (among 232 ones)
As you see, the path to application is not relevant in such cases.
But for sure, when the resources are available in the « classical » file Localizable.strings, path to application is the way to use.
Do you know why these funny guys in Appleland are unable to use standard names for the folders storing localized resources ?
They use : en.lproj and English.lproj fi.lproj and Finnish.lproj fr.lproj and French .lproj it.lproj and Italian.lproj ja.lproj and Japanese.lproj ko.lproj and Korean.lproj no.lproj and Norwegian.lproj po.lproj and Portuguese.lproj ro.lproj and Romanian.lproj ru.lproj and Russian.lproj sv.lproj and Swedish.lproj
Are there first class languages with two names and 2nd class ones with a single name ?
Yvan KOENIG (VALLAURIS, France) jeudi 27 février 2014 10:15:06
|