Changeset 30052
- Timestamp:
- 2015-07-22T20:27:19+12:00 (9 years ago)
- Location:
- main/trunk/release-kits
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/release-kits/kits/rk3/installer/antinstall-config.xml
r29944 r30052 13 13 14 14 <!-- select language page --> 15 <!-- We want a dropdown for installer language selection. 16 <select> is rendered as radio buttons in the GUI version. 17 antinstaller.sourceforge.net/manual.html 18 <large-select>: "The large select has identical options to the select input. 19 Large select enables the list of options to be greater and is displayed differently. 20 In the Swing GUI the options are rendered as a drop-down list. 21 In the text/console UI the options are shown to the user 20 lines at a time." 22 An example: https://github.com/ykyuen/maven-h2o/blob/master/h2o-installer/ant-installer/antinstall-config.xml 23 24 However, to get <large-select> to work as <select> did, needed to modify the AntInstaller code itself 25 in release-kits\shared\core\ant-installer\src\org\tp23\antinstaller\runtime\exe\LoadConfigFilter.java, 26 and also bring the code in antinstaller\input\LargeSelectInput.java up to speed with Oran's changes to <select> 27 in ant-installer\src\org\tp23\antinstaller\input\SelectInput.java 28 29 <option value="hy" text="Armenian"/> 30 <option value="jp" text="æ¥æ¬èª (Japanese)"/> 31 --> 15 32 <page type="input" name="language-selector" displayText=""> 16 33 <comment name="language-selector-explanation"/> 17 < select property="language" defaultValue="en" displayText="" useAsLocale="true">34 <large-select property="language" defaultValue="en" displayText="" useAsLocale="true"> 18 35 <option value="en" text="English"/> 19 36 <option value="fr" text="Français (French)"/> … … 23 40 <option value="zh" text="äžæ (Chinese)"/> 24 41 <option value="ar" text="Arabic"/> 25 </select> 42 <option value="kk" text="ÒÐ°Ð·Ð°Ò (Kazakh)"/> 43 </large-select> 26 44 </page> 27 45 -
main/trunk/release-kits/shared/core/ant-installer/src/org/tp23/antinstaller/input/LargeSelectInput.java
r17514 r30052 19 19 import java.util.MissingResourceException; 20 20 import java.util.ResourceBundle; 21 import java.util.Locale; 21 22 22 23 import org.tp23.antinstaller.InstallerContext; … … 41 42 private LargeSelectInput.Option[] options; 42 43 44 private boolean useAsLocale = false; 45 43 46 public LargeSelectInput() { 44 47 } 45 48 46 49 public void setUseAsLocale(boolean ual) { 50 this.useAsLocale = ual; 51 } 52 47 53 public LargeSelectInput.Option[] getOptions() { 48 54 return options; … … 66 72 public String getText() { 67 73 if( org.tp23.antinstaller.Installer.langPack != null ) { 68 return org.tp23.antinstaller.Installer.langPack.getString(getProperty() + "." + idx +".displayText"); 74 return org.tp23.antinstaller.Installer.langPack.getString(getProperty() + "." + idx +".displayText"); 69 75 } 70 76 return text; … … 72 78 } 73 79 74 public void setValue(String dir){ 75 setInputResult(dir); 80 public void setValue(String value){ //param name used to be "dir" not "value", but bringing in line with SelectInput.java 81 setInputResult(value); 82 if ( useAsLocale ) { 83 //expect something like 'en' or or something like 'en_US' 84 Locale newLocale = null; 85 if ( value.length() == 2 ) { 86 newLocale = new Locale(value); 87 Locale.setDefault( newLocale ); 88 } else if ( value.length() == 5 ) { 89 newLocale = new Locale(value.substring(0,2), value.substring(3,5)); 90 Locale.setDefault( newLocale ); 91 } //else { you're out of luck } 92 org.tp23.antinstaller.Installer.langPack = ResourceBundle.getBundle("resources.LanguagePack", newLocale ); 93 } 76 94 } 77 95 /** -
main/trunk/release-kits/shared/core/ant-installer/src/org/tp23/antinstaller/input/SelectInput.java
r17517 r30052 74 74 String r = org.tp23.antinstaller.Installer.langPack.getString( getProperty() + "." + idx + ".displayText" ); 75 75 return r; 76 } catch ( java.util.MissingResourceException mre ) {} 76 } catch ( java.util.MissingResourceException mre ) {} // restoring original comment: ignore, signifies no language packs installed 77 77 } 78 78 return text; -
main/trunk/release-kits/shared/core/ant-installer/src/org/tp23/antinstaller/runtime/exe/LoadConfigFilter.java
r17514 r30052 345 345 346 346 String s = field.getAttribute("useAsLocale"); 347 if ( s != null || !s.equals("") ) {347 if ( s != null && s.equals("true") ) { 348 348 sInput.setUseAsLocale(true); 349 349 } … … 383 383 sInput.setOptions(optionArr); 384 384 385 String s = field.getAttribute("useAsLocale"); 386 if ( s != null && s.equals("true") ) { 387 sInput.setUseAsLocale(true); 388 } 385 389 return sInput; 386 390 }
Note:
See TracChangeset
for help on using the changeset viewer.