Example usage for java.util Locale CANADA_FRENCH

List of usage examples for java.util Locale CANADA_FRENCH

Introduction

In this page you can find the example usage for java.util Locale CANADA_FRENCH.

Prototype

Locale CANADA_FRENCH

To view the source code for java.util Locale CANADA_FRENCH.

Click Source Link

Document

Useful constant for country.

Usage

From source file:Main.java

public static void main(String[] args) {
    Locale locale = Locale.CANADA_FRENCH;

    System.out.println("Locale1:" + locale);

    System.out.println(locale.getUnicodeLocaleAttributes());

}

From source file:Main.java

public static void main(String[] args) {
    Locale locale = Locale.CANADA_FRENCH;

    System.out.println("Locale1:" + locale);

    System.out.println(locale.getExtensionKeys());

}

From source file:Main.java

public static void main(String[] args) {
    Locale locale = Locale.CANADA_FRENCH;

    System.out.println("Locale1:" + locale);

    System.out.println(locale.getDisplayScript());

}

From source file:Main.java

public static void main(String[] args) {
    Locale locale = Locale.CANADA_FRENCH;

    System.out.println("Locale1:" + locale);

    System.out.println(locale.getScript());

}

From source file:Main.java

public static void main(String[] args) {
    Locale locale = Locale.CANADA_FRENCH;

    System.out.println("Locale1:" + locale);

    System.out.println(locale.getUnicodeLocaleKeys());

}

From source file:Main.java

public static void main(String[] args) {
    Locale locale = Locale.CANADA_FRENCH;

    System.out.println("Locale1:" + locale);

    // print the country of this locale
    System.out.println("Country:" + locale.getCountry());

}

From source file:ShowDate.java

public static void main(String[] args) {
    DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.CANADA_FRENCH);
    System.out.println(df.format(new Date()));
}

From source file:Main.java

public static void main(String args[]) {
    Locale currentLocale = Locale.getDefault();
    Locale locales[] = { Locale.TAIWAN, Locale.KOREA, Locale.ITALY, Locale.CANADA, Locale.CANADA_FRENCH };
    System.out.println("CURRENT LOCALE:");
    describeLocale(currentLocale);/*ww  w .j a  va  2  s .  c om*/
    System.out.println("OTHER LOCALES:");
    for (int i = 0; i < locales.length; ++i)
        describeLocale(locales[i]);
}

From source file:Main.java

public static String getTOSLink() {
    String link = "http://m.google.com/toscountry"; // default

    String locale = Locale.getDefault().toString();
    if (locale.equals(Locale.US.toString())) {
        link = "http://m.google.com/tospage";
    } else if (locale.equals(Locale.UK.toString())) {
        link = "http://m.google.co.uk/tospage";
    } else if (locale.equals(Locale.CANADA.toString())) {
        link = "http://m.google.ca/tospage";
    } else if (locale.equals(Locale.CANADA_FRENCH.toString())) {
        link = "http://m.google.ca/tospage?hl=fr";
    } else if (locale.equals(Locale.FRANCE.toString())) {
        link = "http://m.google.fr/tospage";
    }//from ww w. j a v a  2s  .  com
    return link;
}

From source file:Main.java

private static String constructLink(Locale locale, String path) {
    String domain = locale.getCountry().toLowerCase();

    // ISO-3166-to-TLD exceptions...
    if (domain.equals("us")) {
        domain = "com";
    } else if (domain.equals("ao")) {
        domain = "it.ao";
    } else if (domain.equals("gb")) {
        domain = "co.uk";
    } else {/*ww w. ja v  a 2 s .co m*/
        for (int i = 0; i < DOT_COM.length; i++) {
            if (domain.equals(DOT_COM[i])) {
                domain = "com." + domain;
                break;
            }
        }
        for (int i = 0; i < DOT_CO.length; i++) {
            if (domain.equals(DOT_CO[i])) {
                domain = "co." + domain;
                break;
            }
        }
        if (locale.toString().equals(Locale.CANADA_FRENCH.toString())) {
            path += "?hl=fr";
        }
    }

    return "http://m.google." + domain + path;
}