AppleScript名:言語コードから言語名を取得する |
— Created 2015-12-21 13:13:24 +0900 by Takaaki Naganoya — 2015 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set countryCode to "en" set ident to current application’s NSLocale’s preferredLanguages()’s firstObject() –> (NSArray) {"ja", "en-US", "en-GB", "en", "fr"} set aLocale to current application’s NSLocale’s alloc()’s initWithLocaleIdentifier:ident set aCountryName to aLocale’s displayNameForKey:(current application’s NSLocaleIdentifier) value:countryCode –> (NSString) "英語 (アメリカ合衆国)" |
More from my site
(Visited 40 times, 1 visits today)