Examples of Locale


Examples of java.util.Locale

    String language = Settings.propLanguage.getString();
    String country = Settings.propCountry.getString();
    String variant = Settings.propVariant.getString();

    Locale loc = new Locale(language, country, variant);
    if (localesList.contains(loc)) {
      mLanguageCB.setSelectedItem(loc);
    }
    else {
      loc = new Locale(language, country);
      if (localesList.contains(loc)) {
        mLanguageCB.setSelectedItem(loc);
      }
      else {
        loc = new Locale(language);
        if (localesList.contains(loc)) {
          mLanguageCB.setSelectedItem(loc);
        }
      }
    }
View Full Code Here

Examples of java.util.Locale

  /**
   * Called by the host-application, if the user wants to save the settings.
   */
  public void saveSettings() {
    Locale loc = (Locale) mLanguageCB.getSelectedItem();

    Settings.propLanguage.setString(loc.getLanguage());
    Settings.propCountry.setString(loc.getCountry());
    Settings.propVariant.setString(loc.getVariant());

    try {
      Settings.propTimezone.setString((String) mTimezoneCB.getSelectedItem());
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of java.util.Locale

      LocaleConfig ma = new LocaleConfigImpl();
      ma.setLocale("ma");
      assertEquals("ma", ma.getLocaleName());

      LocaleConfig ma1 = new LocaleConfigImpl();
      ma1.setLocale(new Locale("ma"));
      assertEquals("ma", ma1.getLocaleName());
   }
View Full Code Here

Examples of java.util.Locale

      assertLocaleConfig(en, "en", "Default configuration for english locale", "UTF-8", "UTF-8", Orientation.LT,
         Locale.ENGLISH);
      assertLocaleConfig(fr, "fr", "Default configuration for the french locale", "UTF-8", "UTF-8", Orientation.LT,
         Locale.FRENCH);
      assertLocaleConfig(ar, "ar", "Default configuration for the arabic locale", "UTF-8", "UTF-8", Orientation.RT,
         new Locale("ar"));
      assertLocaleConfig(vi, "vi", "Default configuration for the vietnam locale", "UTF-8", "UTF-8", Orientation.LT,
         new Locale("vi"));
   }
View Full Code Here

Examples of java.util.Locale

        if(pos > 0) {
            String getsArg = uri.substring(SYSTEM_COLLATION.length());
            final int sharppos = getsArg.indexOf('#');
            String qloc = (sharppos > 0) ? getsArg.substring(0, sharppos - 1) : getsArg;
            String args[] = qloc.split("-");
            final Locale loc;
            final int loclen = args.length;
            switch(loclen) {
                case 1:
                    loc = new Locale(args[0]);
                    break;
                case 2:
                    loc = new Locale(args[0], args[1]);
                    break;
                case 3:
                    loc = new Locale(args[0], args[1], args[2]);
                    break;
                default:
                    throw new IllegalArgumentException("invalid collation uri: " + uri);
            }
            final Collator col = Collator.getInstance(loc);
View Full Code Here

Examples of java.util.Locale

   
    String[] drop_labels = new String[ locales.length ];
    String[] drop_values = new String[ locales.length ];
    int iUsingLocale = -1;
    for( int i=0; i < locales.length; i++ ) {
      Locale locale = locales[ i ];
      String sName = locale.getDisplayName(locale);
      String sName2 = locale.getDisplayName();
      if (!sName.equals(sName2)) {
        sName += " - " + sName2;
      }
      drop_labels[ i ] = sName + " - " + locale;
      drop_values[ i ] = locale.toString();
      if (MessageText.isCurrentLocale(locale))
        iUsingLocale = i;
    }
   
    StringListParameter locale_param = new StringListParameter(cMain, "locale",
View Full Code Here

Examples of java.util.Locale

    String sessionID = requestForm.getSessionID();
    HttpSession session = request.getSession();
    UserObject userobjectd = (UserObject)session.getAttribute("userobject");
    UserPrefererences userPrefs = userobjectd.getUserPref();
    TimeZone tz = TimeZone.getTimeZone(userPrefs.getTimeZone());
    Locale locale = request.getLocale();
    int individualID = userobjectd.getIndividualID();
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    // date format for writing to the form should be in the format based on
    // locale
    DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
View Full Code Here

Examples of java.util.Locale

    request.setAttribute("showCustomViews", new Boolean(false));
    request.setAttribute("showComposeButton", new Boolean(false));
    request.setAttribute("showNewButton", new Boolean(false));
    request.setAttribute("showPrintButton", new Boolean(false));
    // Description must allow i18n
    Locale locale = request.getLocale();
    MessageResources messages = MessageResources.getMessageResources("ApplicationResources");
    String searchButtonDescription = messages.getMessage(locale,
        "label.home.searchbutton.description");
    request.setAttribute("searchButtonDescription", searchButtonDescription);
    request.setAttribute("hideListDropdown", new Boolean(true));
View Full Code Here

Examples of java.util.Locale

    UserObject userobjectd = (UserObject)session.getAttribute("userobject");

    // get the user's preference for sync'ing as private or default privileges
    UserPrefererences userPrefs = userobjectd.getUserPref();
    TimeZone tz = TimeZone.getTimeZone(userPrefs.getTimeZone());
    Locale locale = request.getLocale();
    String prefValue = userPrefs.getSyncAsPrivate();
    boolean syncAsPrivate = (prefValue != null && prefValue.equals("YES")) ? true : false;

    // date format for incoming dates: 2004-01-13 15:00:00
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
View Full Code Here

Examples of java.util.Locale

  public void readFurnitureLibrary(final FurnitureLibrary furnitureLibrary,
                                   String furnitureLibraryName,
                                   FurnitureLibraryUserPreferences preferences) throws RecorderException {
    try {
      // Retrieve furniture library with default reader and locale
      Locale defaultLocale = Locale.getDefault();
      Locale.setDefault(DEFAULT_LOCALE);
      File furnitureLibraryFile = File.createTempFile("furniture", ".sh3f");
      furnitureLibraryFile.deleteOnExit();
      copyFile(new File(furnitureLibraryName), furnitureLibraryFile);     
      URL furnitureLibraryUrl = furnitureLibraryFile.toURI().toURL();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.