Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.Locale;

public class Main {
    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";
        }
        return link;
    }
}