Example usage for java.util Locale FRANCE

List of usage examples for java.util Locale FRANCE

Introduction

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

Prototype

Locale FRANCE

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

Click Source Link

Document

Useful constant for country.

Usage

From source file:Main.java

static public void main(String[] args) {

    Locale list[] = SimpleDateFormat.getAvailableLocales();

    for (int i = 0; i < list.length; i++) {
        System.out.println(list[i].toString());
    }/*from   ww  w . j  a v  a2 s. co m*/

    for (int i = 0; i < list.length; i++) {
        System.out.println(list[i].getDisplayName());
    }

    for (int i = 0; i < list.length; i++) {
        System.out.println(list[i].getDisplayName(Locale.FRANCE));
    }

}

From source file:Main.java

public static void main(String args[]) {
    int style = DateFormat.MEDIUM;
    // Also try with style = DateFormat.FULL and DateFormat.SHORT
    Date date = new Date();
    DateFormat df;//  ww  w  .  ja  v  a  2 s . c  o m
    df = DateFormat.getDateInstance(style, Locale.UK);
    System.out.println("United Kingdom: " + df.format(date));
    df = DateFormat.getDateInstance(style, Locale.US);
    System.out.println("USA: " + df.format(date));
    df = DateFormat.getDateInstance(style, Locale.FRANCE);
    System.out.println("France: " + df.format(date));
    df = DateFormat.getDateInstance(style, Locale.ITALY);
    System.out.println("Italy: " + df.format(date));
    df = DateFormat.getDateInstance(style, Locale.JAPAN);
    System.out.println("Japan: " + df.format(date));
}

From source file:MainClass.java

public static void main(String[] args) {
    Date today = new Date();
    Locale[] locales = { Locale.US, Locale.UK, Locale.GERMANY, Locale.FRANCE };

    int[] styles = { DateFormat.FULL, DateFormat.LONG, DateFormat.MEDIUM, DateFormat.SHORT };

    DateFormat fmt;//from w  w w  .j av  a 2 s .  c om
    String[] styleText = { "FULL", "LONG", "MEDIUM", "SHORT" };

    // Output the date for each local in four styles
    for (int i = 0; i < locales.length; i++) {
        System.out.println("\nThe Date for " + locales[i].getDisplayCountry() + ":");
        for (int j = 0; j < styles.length; j++) {
            fmt = DateFormat.getDateInstance(styles[j], locales[i]);
            System.out.println("\tIn " + styleText[j] + " is " + fmt.format(today));
        }
    }
}

From source file:Test.java

public static void main(String[] args) {
    BigDecimal value = new BigDecimal(12345);
    Locale.setDefault(Locale.JAPAN);
    System.out.printf("Default locale: %s\n", Locale.getDefault().getDisplayName());
    NumberFormat nf = NumberFormat.getCurrencyInstance();
    String formattedCurrency = nf.format(value);
    System.out.printf("%s\n", formattedCurrency);
    nf.setCurrency(Currency.getInstance(Locale.US));
    formattedCurrency = nf.format(value);
    System.out.printf("%s\n\n", formattedCurrency);

    Locale.setDefault(Locale.US);
    System.out.printf("Default locale: %s\n", Locale.getDefault().getDisplayName());
    nf = NumberFormat.getCurrencyInstance();
    formattedCurrency = nf.format(value);
    System.out.printf("%s\n", formattedCurrency);
    nf.setCurrency(Currency.getInstance("JPY"));
    formattedCurrency = nf.format(value);
    System.out.printf("%s\n\n", formattedCurrency);

    Locale.setDefault(Locale.FRANCE);
    System.out.printf("Default locale: %s\n", Locale.getDefault().getDisplayName());
    nf = NumberFormat.getCurrencyInstance();
    formattedCurrency = nf.format(value);
    System.out.printf("%s\n", formattedCurrency);
    nf.setCurrency(Currency.getInstance("USD"));
    formattedCurrency = nf.format(value);
    System.out.printf("%s\n\n", formattedCurrency);
}

From source file:com.apress.prospringintegration.corespring.i18n.MainI18n.java

public static void main(String[] args) {
    ApplicationContext ctx = new ClassPathXmlApplicationContext("ioc_resource_bundles.xml");

    String qMessage = ctx.getMessage("queued", null, Locale.US);
    System.out.println(qMessage);

    qMessage = ctx.getMessage("queued", null, Locale.UK);
    System.out.println(qMessage);

    String filename = "ProSpringIntegration.xml";
    MessageSourceResolvable processed = new DefaultMessageSourceResolvable(new String[] { "complete" },
            new String[] { filename }, " Your data has been processed!");
    String msrQmessage = ctx.getMessage(processed, Locale.FRANCE);
    System.out.println(msrQmessage);

}

From source file:TestFormat.java

public static void main(String[] args) {
    long n = 461012;
    System.out.format("%d%n", n);
    System.out.format("%08d%n", n);
    System.out.format("%+8d%n", n);
    System.out.format("%,8d%n", n);
    System.out.format("%+,8d%n%n", n);

    double pi = Math.PI;
    System.out.format("%f%n", pi);
    System.out.format("%.3f%n", pi);
    System.out.format("%10.3f%n", pi);
    System.out.format("%-10.3f%n", pi);
    System.out.format(Locale.FRANCE, "%-10.4f%n%n", pi);

    Calendar c = Calendar.getInstance();
    System.out.format("%tB %te, %tY%n", c, c, c);
    System.out.format("%tl:%tM %tp%n", c, c, c);
    System.out.format("%tD%n", c);
}

From source file:com.bialx.ebics.FDL.java

public static void main(String[] args) throws Exception {
    String userId = "";
    Boolean isTest = false;/*from   ww  w .  ja  va  2s.c o m*/
    Date startDate = null;
    Date endDate = null;

    SimpleDateFormat dtFormat = new SimpleDateFormat("yyyyMMdd");

    CommandLineParser parser = new DefaultParser();

    BialxOptions options = new BialxOptions();

    // Parse the program arguments
    CommandLine commandLine = parser.parse(options, args);

    // optional values
    if (commandLine.hasOption('s')) {
        startDate = dtFormat.parse(commandLine.getOptionValue('s'));
    }

    if (commandLine.hasOption('e')) {
        endDate = dtFormat.parse(commandLine.getOptionValue('e'));
    }

    if (commandLine.hasOption('t')) {
        isTest = true;
    }

    FDL fdl;
    PasswordCallback pwdHandler;
    Product product;

    fdl = new FDL();

    pwdHandler = new UserPasswordHandler(userId, CERT_PASSWORD);

    product = new Product("Bial-x EBICS FDL", Locale.FRANCE, null);

    if (commandLine.hasOption(BialxOptions.OPTION_CREATION)
            && !commandLine.hasOption(BialxOptions.OPTION_DOWNLOAD)) {
        if (options.checkCreationOptions(commandLine)) {
            CreationOptions co = options.loadCreationOptions(commandLine);
            fdl.configuration.getLogger().info(String.format("Banque : %s", co.getBankName()));
            fdl.configuration.getLogger().info(String.format("Host : %s", co.getHostId()));
            fdl.configuration.getLogger().info(String.format("URL : %s", co.getBankUrl()));
            fdl.configuration.getLogger().info(String.format("Partner : %s", co.getPartnerId()));
            fdl.configuration.getLogger().info(String.format("User : %s", co.getUserId()));
            User user = fdl.createUser(co.getUserId(), co.getHostId(), co.getPartnerId(), co.getBankName(),
                    co.getBankUrl(), pwdHandler);
            fdl.sendHPBRequest(user, product);
        } else {
            fdl.configuration.getLogger().info("Vrifiez les paramtres de la commande.");
            System.exit(0);
        }
    }

    if (!commandLine.hasOption(BialxOptions.OPTION_CREATION)
            && commandLine.hasOption(BialxOptions.OPTION_DOWNLOAD)) {
        if (options.checkDownloadOptions(commandLine)) {
            DownloadOptions dop = options.loadDownloadOptions(commandLine);
            fdl.configuration.getLogger().info(String.format("Banque : %s", dop.getHostId()));
            fdl.configuration.getLogger().info(String.format("Host : %s", dop.getHostId()));
            fdl.configuration.getLogger().info(String.format("Partner : %s", dop.getPartnerId()));
            fdl.configuration.getLogger().info(String.format("User : %s", dop.getUserId()));
            fdl.configuration.getLogger().info(String.format("Format : %s", dop.getFormat()));
            fdl.configuration.getLogger().info(String.format("Destination : %s", dop.getDestination()));
            if (startDate != null) {
                fdl.configuration.getLogger()
                        .info(String.format("Date dbut : %s", dtFormat.format(startDate)));
            }
            if (endDate != null) {
                fdl.configuration.getLogger().info(String.format("Date fin : %s", dtFormat.format(endDate)));
            }
            fdl.loadUser(dop.getHostId(), dop.getPartnerId(), dop.getUserId(), pwdHandler);
            fdl.fetchFile(dop.getDestination(), dop.getUserId(), dop.getFormat(), product, OrderType.FDL,
                    isTest, startDate, endDate);
        } else {
            fdl.configuration.getLogger().info("Vrifiez les paramtres de la commande.");
            System.exit(0);
        }
    }

    if (commandLine.hasOption(BialxOptions.OPTION_DOWNLOAD)
            && commandLine.hasOption(BialxOptions.OPTION_CREATION)) {
        fdl.configuration.getLogger().error("Impossible d'avoir les options C et D dans la mme commande.");
        System.exit(0);
    }

    fdl.quit();
}

From source file:HBBRequestor.java

public static void main(String[] args) throws Exception {
    String hostId = "";
    String partnerId = "";
    String userId = "";

    CommandLineParser parser = new BasicParser();
    Options options = new Options();
    options.addOption("h", "host", true, "EBICS Host ID");
    options.addOption("p", "partner", true, "Registred Partner ID for you user");
    options.addOption("u", "user", true, "User ID to initiate");

    // Parse the program arguments
    CommandLine commandLine = parser.parse(options, args);

    if (!commandLine.hasOption('h')) {
        System.out.println("Host-ID is mandatory");
        System.exit(0);// w w w  .j a  v a 2 s.  com
    } else {
        hostId = commandLine.getOptionValue('h');
        System.out.println("host: " + hostId);
    }

    if (!commandLine.hasOption('p')) {
        System.out.println("Partner-ID is mandatory");
        System.exit(0);
    } else {
        partnerId = commandLine.getOptionValue('p');
        System.out.println("partnerId: " + partnerId);
    }

    if (!commandLine.hasOption('u')) {
        System.out.println("User-ID is mandatory");
        System.exit(0);
    } else {
        userId = commandLine.getOptionValue('u');
        System.out.println("userId: " + userId);
    }

    HBBRequestor hbbRequestor;
    PasswordCallback pwdHandler;
    Product product;

    hbbRequestor = new HBBRequestor();
    product = new Product("kopiLeft Dev 1.0", Locale.FRANCE, null);
    pwdHandler = new UserPasswordHandler(userId, "2012");

    // Load alredy created user
    hbbRequestor.loadUser(hostId, partnerId, userId, pwdHandler);

    // Send hbb Requets
    hbbRequestor.sendHPBRequest(userId, product);

    // Perform save for the changed data
    hbbRequestor.quit();
}

From source file:FDLRequestor.java

public static void main(String[] args) throws Exception {
    String hostId = "";
    String partnerId = "";
    String userId = "";

    CommandLineParser parser = new BasicParser();
    Options options = new Options();
    options.addOption("h", "host", true, "EBICS Host ID");
    options.addOption("p", "partner", true, "Registred Partner ID for you user");
    options.addOption("u", "user", true, "User ID to initiate");

    // Parse the program arguments
    CommandLine commandLine = parser.parse(options, args);

    if (!commandLine.hasOption('h')) {
        System.out.println("Host-ID is mandatory");
        System.exit(0);/*  ww  w  . ja  v  a  2 s  .c o  m*/
    } else {
        hostId = commandLine.getOptionValue('h');
        System.out.println("host: " + hostId);
    }

    if (!commandLine.hasOption('p')) {
        System.out.println("Partner-ID is mandatory");
        System.exit(0);
    } else {
        partnerId = commandLine.getOptionValue('p');
        System.out.println("partnerId: " + partnerId);
    }

    if (!commandLine.hasOption('u')) {
        System.out.println("User-ID is mandatory");
        System.exit(0);
    } else {
        userId = commandLine.getOptionValue('u');
        System.out.println("userId: " + userId);
    }

    FDLRequestor fdlRequestor;
    PasswordCallback pwdHandler;
    Product product;
    String filePath;

    fdlRequestor = new FDLRequestor();
    product = new Product("kopiLeft Dev 1.0", Locale.FRANCE, null);
    pwdHandler = new UserPasswordHandler(userId, "2012");

    // Load alredy created user
    fdlRequestor.loadUser(hostId, partnerId, userId, pwdHandler);

    filePath = System.getProperty("user.home") + File.separator + "download.txt";

    // Send FDL Requets
    fdlRequestor.fetchFile(filePath, userId, product, OrderType.FDL, true, null, null);
}

From source file:FULRequestor.java

public static void main(String[] args) throws Exception {
    String hostId = "";
    String partnerId = "";
    String userId = "";

    CommandLineParser parser = new BasicParser();
    Options options = new Options();
    options.addOption("h", "host", true, "EBICS Host ID");
    options.addOption("p", "partner", true, "Registred Partner ID for you user");
    options.addOption("u", "user", true, "User ID to initiate");

    // Parse the program arguments
    CommandLine commandLine = parser.parse(options, args);

    if (!commandLine.hasOption('h')) {
        System.out.println("Host-ID is mandatory");
        System.exit(0);// www  .ja  v  a2 s  .c om
    } else {
        hostId = commandLine.getOptionValue('h');
        System.out.println("host: " + hostId);
    }

    if (!commandLine.hasOption('p')) {
        System.out.println("Partner-ID is mandatory");
        System.exit(0);
    } else {
        partnerId = commandLine.getOptionValue('p');
        System.out.println("partnerId: " + partnerId);
    }

    if (!commandLine.hasOption('u')) {
        System.out.println("User-ID is mandatory");
        System.exit(0);
    } else {
        userId = commandLine.getOptionValue('u');
        System.out.println("userId: " + userId);
    }

    FULRequestor hbbRequestor;
    PasswordCallback pwdHandler;
    Product product;
    String filePath;

    hbbRequestor = new FULRequestor();
    product = new Product("kopiLeft Dev 1.0", Locale.FRANCE, null);
    pwdHandler = new UserPasswordHandler(userId, "2012");

    // Load alredy created user
    hbbRequestor.loadUser(hostId, partnerId, userId, pwdHandler);

    filePath = System.getProperty("user.home") + File.separator + "test.txt";
    // Send FUL Requets
    hbbRequestor.sendFile(filePath, userId, product);
}