Examples of toLanguageTag()


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;
      if (!locale.toLanguageTag().equalsIgnoreCase(tag)) return false;
      return true;
    } catch (Exception e) {
View Full Code Here

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

    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;
      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()

        }
            // 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 java.util.Locale.toLanguageTag()

   */
  public void openLocaleLang() {
   
    Locale newLocale=Locale.getDefault();
       
    this.lang = newLocale.toLanguageTag();
    if(this.root.getChild(lang) != null)
    {
      this.language=this.root.getChild(lang);
    }
    else
View Full Code Here

Examples of java.util.Locale.toLanguageTag()

        String contactsFile = getFileInfo("/api/contacts.json");
        JsonParser parser = new JsonParser();
        JsonObject jObj = (JsonObject) parser.parse(contactsFile);

        if (Locale.UK.equals(locale)) {
            return jObj.get(locale.toLanguageTag()).toString();
        } else {
            return jObj.get("pt-PT").toString();
        }
    }
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.