@Override public List<String> applicationLocales() { return proxy.applicationLocales(); }
/** * @return The preferred locale of all localizations available * in this application bundle */ public String locale() { return this.applicationLocales().iterator().next(); }
log.info(String.format("Running Java %s on %s", System .getProperty("java.version"), System.getProperty("os.arch"))); log.info(String.format("Available localizations:%s", preferences.applicationLocales())); log.info(String.format("Native library path:%s", System.getProperty("java.library.path"))); log.info(String.format("Using default encoding %s", System.getProperty("file.encoding")));
public void setLanguagePopup(NSPopUpButton b) { this.languagePopup = b; this.languagePopup.removeAllItems(); this.languagePopup.setTarget(this.id()); this.languagePopup.setAction(Foundation.selector("languagePopupClicked:")); this.languagePopup.addItemWithTitle(LocaleFactory.localizedString("Default")); this.languagePopup.menu().addItem(NSMenuItem.separatorItem()); String custom = null; if(preferences.systemLocales().size() > 1) { // No user default application scope single value of AppleLanguages property is set but a list // of preferred languages from system preferences is returned. this.languagePopup.selectItemWithTitle(LocaleFactory.localizedString("Default")); } else { // Custom language set for this application identifier custom = preferences.locale(); } for(String identifier : preferences.applicationLocales()) { this.languagePopup.addItemWithTitle(preferences.getDisplayName(identifier)); this.languagePopup.lastItem().setRepresentedObject(identifier); if(identifier.equals(custom)) { this.languagePopup.selectItem(this.languagePopup.lastItem()); } } }