AppleScript名:すべてのLocaleから各種情報を取得 |
— Created 2015-10-03 00:17:01 +0900 by Takaaki Naganoya — 2015 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set allLocaleIdentifiers to (current application’s NSLocale’s availableLocaleIdentifiers()) as list set cList to {} repeat with i in allLocaleIdentifiers set j to contents of i set tmpLoc to (current application’s NSLocale’s alloc()’s initWithLocaleIdentifier:j) set aLangCode to (tmpLoc’s objectForKey:(current application’s NSLocaleLanguageCode)) as text set aCountryCode to (tmpLoc’s objectForKey:(current application’s NSLocaleCountryCode)) as text set aCCYSymbol to (tmpLoc’s objectForKey:(current application’s NSLocaleCurrencySymbol)) as text set aLocID to (tmpLoc’s objectForKey:(current application’s NSLocaleIdentifier)) as text –set aCountryName to (tmpLoc’s displayNameForKey:(current application’s NSLocaleCountryCode)) set locIDDisplayName to (tmpLoc’s displayNameForKey:(current application’s NSLocaleIdentifier) value:aLocID) as text set the end of cList to {aLocID, aLangCode, aCountryCode, aCCYSymbol, locIDDisplayName} end repeat cList –> {{"eu", "eu", "missing value", "¤", "euskara"},…. {"ja_JP", "ja", "JP", "¥", "日本語 (日本)"}, ….. {"ja", "ja", "missing value", "¤", "日本語"}, ………., {"en_US", "en", "US", "$", "English (United States)"}, {"en_US_POSIX", "en", "US", "$", "English (United States, Computer)"}, {"zh-Hans", "zh", "missing value", "¤", "中文(简体)"},….. {"zh-Hant", "zh", "missing value", "¤", "中文(繁體)"}, ….{"zh-Hans_HK", "zh", "HK", "HK$", "中文(简体、中国香港特别行政区)"},} |
More from my site
(Visited 47 times, 1 visits today)