Examples of toLanguageTag()


Examples of com.ibm.icu.util.ULocale.toLanguageTag()

   */
  public static boolean isValidLanguageTag(String tag){
    try {
      if (tag.equals("x-w3c-test")) return true; // hack for testing :(
      ULocale locale = ULocale.forLanguageTag(tag);
      if (locale.toLanguageTag() == null) return false;
      // We don't accept "x" extensions (private use tags)
      if(locale.getExtension("x".charAt(0))!=null) return false;
      if (!locale.toLanguageTag().equalsIgnoreCase(tag)) return false;
      return true;
    } catch (Exception e) {
View Full Code Here

Examples of com.ibm.icu.util.ULocale.toLanguageTag()

      if (tag.equals("x-w3c-test")) return true; // hack for testing :(
      ULocale locale = ULocale.forLanguageTag(tag);
      if (locale.toLanguageTag() == null) return false;
      // We don't accept "x" extensions (private use tags)
      if(locale.getExtension("x".charAt(0))!=null) return false;
      if (!locale.toLanguageTag().equalsIgnoreCase(tag)) return false;
      return true;
    } catch (Exception e) {
      return false;
    }
  }
View Full Code Here

Examples of com.ibm.icu.util.ULocale.toLanguageTag()

        }
            // We don't accept "x" extensions (private use tags)
            if (locale.getExtension("x".charAt(0)) != null) {
                return false;
        }
            if (!locale.toLanguageTag().equalsIgnoreCase(tag)) {
                return false;
        }
            return true;
        } catch (Exception e) {
            return false;
View Full Code Here

Examples of com.ibm.icu.util.ULocale.toLanguageTag()

     * @return true if a valid language tag, otherwise false
     */
    public static boolean isValidLanguageTag(String tag) {
        try {
            ULocale locale = ULocale.forLanguageTag(tag);
            if (locale.toLanguageTag() == null) {
                return false;
        }
            // We don't accept "x" extensions (private use tags)
            if (locale.getExtension("x".charAt(0)) != null) {
                return false;
View Full Code Here

Examples of com.ibm.icu.util.ULocale.toLanguageTag()

   */
  public static boolean isValidLanguageTag(String tag){
    try {
      if (tag.equals("x-w3c-test")) return true; // hack for testing :(
      ULocale locale = ULocale.forLanguageTag(tag);
      if (locale.toLanguageTag() == null) return false;
      // We don't accept "x" extensions (private use tags)
      if(locale.getExtension("x".charAt(0))!=null) return false;
      if (!locale.toLanguageTag().equalsIgnoreCase(tag)) return false;
      return true;
    } catch (Exception e) {
View Full Code Here

Examples of com.ibm.icu.util.ULocale.toLanguageTag()

      if (tag.equals("x-w3c-test")) return true; // hack for testing :(
      ULocale locale = ULocale.forLanguageTag(tag);
      if (locale.toLanguageTag() == null) return false;
      // We don't accept "x" extensions (private use tags)
      if(locale.getExtension("x".charAt(0))!=null) return false;
      if (!locale.toLanguageTag().equalsIgnoreCase(tag)) return false;
      return true;
    } catch (Exception e) {
      return false;
    }
  }
View Full Code Here

Examples of com.ibm.icu.util.ULocale.toLanguageTag()

                ULocale loc = bld.create();
                if (!expected[1].equals(loc.toString())) {
                    errln("FAIL: Wrong locale ID - " + loc +
                            " for test case: " + Utility.arrayToString(TESTCASE[tidx]));
                }
                String langtag = loc.toLanguageTag();
                if (!expected[0].equals(langtag)) {
                    errln("FAIL: Wrong language tag - " + langtag +
                            " for test case: " + Utility.arrayToString(TESTCASE[tidx]));
                }
                ULocale loc1 = ULocale.forLanguageTag(langtag);
View Full Code Here

Examples of com.ibm.icu.util.ULocale.toLanguageTag()

            {"it@collation=badcollationtype;colStrength=identical;cu=usd-eur", "it-u-ks-identic"},
        };

        for (int i = 0; i < locale_to_langtag.length; i++) {
            ULocale loc = new ULocale(locale_to_langtag[i][0]);
            String langtag = loc.toLanguageTag();
            if (!langtag.equals(locale_to_langtag[i][1])) {
                errln("FAIL: toLanguageTag returned language tag [" + langtag + "] for locale ["
                        + loc + "] - expected: [" + locale_to_langtag[i][1] + "]");
            }
        }
View Full Code Here

Examples of com.ibm.icu.util.ULocale.toLanguageTag()

   */
  public static boolean isValidLanguageTag(String tag){
    try {
      if (tag.equals("x-w3c-test")) return true; // hack for testing :(
      ULocale locale = ULocale.forLanguageTag(tag);
      if (locale.toLanguageTag() == null) return false;
      // We don't accept "x" extensions (private use tags)
      if(locale.getExtension("x".charAt(0))!=null) return false;
      if (!locale.toLanguageTag().equalsIgnoreCase(tag)) return false;
      return true;
    } catch (Exception e) {
View Full Code Here

Examples of com.ibm.icu.util.ULocale.toLanguageTag()

      if (tag.equals("x-w3c-test")) return true; // hack for testing :(
      ULocale locale = ULocale.forLanguageTag(tag);
      if (locale.toLanguageTag() == null) return false;
      // We don't accept "x" extensions (private use tags)
      if(locale.getExtension("x".charAt(0))!=null) return false;
      if (!locale.toLanguageTag().equalsIgnoreCase(tag)) return false;
      return true;
    } catch (Exception e) {
      return false;
    }
  }
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.