Examples of GwtLocale


Examples of com.google.gwt.i18n.shared.GwtLocale

   *
   * @param locale
   * @return GwtLocale of nearest ancestor
   */
  public GwtLocale inheritsFrom(GwtLocale locale) {
    GwtLocale parent = inheritsFrom.get(locale);
    while (parent != null && parent != defaultLocale) {
      for (Map.Entry<MapKey, Map<String, String>> entry : maps.entrySet()) {
        MapKey key = entry.getKey();
        // Version entries are always present, so ignore them
        if (!"version".equals(key.getCategory()) && key.getLocale().equals(parent)) {
View Full Code Here

Examples of com.google.gwt.i18n.shared.GwtLocale

   * @param category
   * @param locale
   * @return GwtLocale of nearest ancestor with the specified category
   */
  public GwtLocale inheritsFrom(String category, GwtLocale locale) {
    GwtLocale parent = inheritsFrom.get(locale);
    while (parent != null && parent != defaultLocale) {
      Map<String, String> map = getMap(category, parent);
      if (!map.isEmpty()) {
        return parent;
      }
View Full Code Here

Examples of com.google.gwt.i18n.shared.GwtLocale

    for (MapKey key : keys) {
      String category = key.getCategory();
      if (matchCategory != null && !matchCategory.equals(category)) {
        continue;
      }
      GwtLocale locale = key.getLocale();
      GwtLocale parent = inheritsFrom(category, locale);
      if (parent == null) {
        continue;
      }
      MapKey parentKey = key.inNewLocale(parent);
      Map<String, String> parentMap = maps.get(parentKey);
View Full Code Here

Examples of com.google.gwt.i18n.shared.GwtLocale

    for (MapKey key : keys) {
      String category = key.getCategory();
      if (matchCategory != null && !matchCategory.equals(category)) {
        continue;
      }
      GwtLocale locale = key.getLocale();
      GwtLocale parent = inheritsFrom(category, locale);
      if (parent == null) {
        continue;
      }
      MapKey parentKey = key.inNewLocale(parent);
      Map<String, String> parentMap = maps.get(parentKey);
View Full Code Here

Examples of com.google.gwt.i18n.shared.GwtLocale

      }
      String language = locale.getAsString();
      Map<String, Double> valueMap = new HashMap<String, Double>();
      for (RegionLanguageData.RegionPopulation langData : regionLanguageData.getRegions(language)) {
        String region = langData.getRegion();
        GwtLocale regionLocale = localeFactory.fromString(language + "_" + region);
        String value = getTerritoryData(regionLocale, values);
        if (value != null) {
          Double pop = valueMap.get(value);
          if (pop == null) {
            pop = 0.0;
View Full Code Here

Examples of com.google.gwt.i18n.shared.GwtLocale

        "type");
  }

  private void buildInheritsFrom() {
    for (GwtLocale locale : allLocales.keySet()) {
      GwtLocale parent = null;
      for (GwtLocale search : locale.getInheritanceChain()) {
        if (!search.equals(locale) && allLocales.containsKey(search)) {
          parent = search;
          break;
        }
View Full Code Here

Examples of com.google.gwt.i18n.shared.GwtLocale

    localeDepth.put(defaultLocale, 0);
    remaining.remove(defaultLocale);
    while (!remaining.isEmpty()) {
      Set<GwtLocale> nextPass = new HashSet<GwtLocale>();
      for (GwtLocale locale : remaining) {
        GwtLocale parent = inheritsFrom.get(locale);
        if (localeDepth.containsKey(parent)) {
          int depth = localeDepth.get(parent);
          localeDepth.put(locale, depth + 1);
        } else {
          nextPass.add(locale);
View Full Code Here

Examples of com.google.gwt.i18n.shared.GwtLocale

      return true;
    }
    if (!(obj instanceof GwtLocale)) {
      return false;
    }
    GwtLocale other = (GwtLocale) obj;
    return equalsNullCheck(language, other.getLanguage())
        && equalsNullCheck(region, other.getRegion())
        && equalsNullCheck(script, other.getScript())
        && equalsNullCheck(variant, other.getVariant());
  }
View Full Code Here

Examples of com.google.gwt.i18n.shared.GwtLocale

  public List<GwtLocale> getAliases() {
    // TODO(jat): more locale aliases? better way to encode them?
    if (cachedAliases == null) {
      cachedAliases = new ArrayList<GwtLocale>();
      GwtLocale canonicalForm = getCanonicalForm();
      Set<GwtLocale> seen = new HashSet<GwtLocale>();
      cachedAliases.add(canonicalForm);
      ArrayList<GwtLocale> nextGroup = new ArrayList<GwtLocale>();
      nextGroup.add(this);
      // Account for default script
View Full Code Here

Examples of com.google.gwt.i18n.shared.GwtLocale

    if (cachedSearchList == null) {
      cachedSearchList = new ArrayList<GwtLocale>();
      Set<GwtLocale> seen = new HashSet<GwtLocale>();
      List<GwtLocale> thisGroup = new ArrayList<GwtLocale>(this.getAliases());
      seen.addAll(thisGroup);
      GwtLocale defLocale = factory.getDefault();
      seen.add(defLocale);
      while (!thisGroup.isEmpty()) {
        cachedSearchList.addAll(thisGroup);
        List<GwtLocale> nextGroup = new ArrayList<GwtLocale>();
        for (GwtLocale locale : thisGroup) {
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.