Examples of LocaleInfo


Examples of com.google.gwt.i18n.client.LocaleInfo

        } else {
            display.getUserLoginLabel().setText(messages.notLoggedIn());
            display.getSignInSignOutAnchor().setHref(loginDto.getLoginUrl());
            display.getSignInSignOutAnchor().setText(messages.signIn());
        }
        LocaleInfo currentLocale = LocaleInfo.getCurrentLocale();
        if ("ru".equals(currentLocale.getLocaleName())) {
            display.getEnglishAnchor().setHref(loginDto.getEnglishUrl());
            display.getEnglishAnchor().setVisible(true);
        } else {
            display.getRussianAnchor().setHref(loginDto.getRussianUrl());
            display.getRussianAnchor().setVisible(true);
View Full Code Here

Examples of com.google.gwt.i18n.client.LocaleInfo

     *            Format string e.g. "d M yyyy"
     * @return The date string where the month names have been replaced by the
     *         browser locale version
     */
    private String parseMonthName(String enteredDate, String formatString) {
        LocaleInfo browserLocale = LocaleInfo.getCurrentLocale();
        if (browserLocale.getLocaleName().equals(getLocale())) {
            // No conversion needs to be done when locales match
            return enteredDate;
        }
        String[] browserMonthNames = browserLocale.getDateTimeConstants()
                .months();
        String[] browserShortMonthNames = browserLocale.getDateTimeConstants()
                .shortMonths();

        if (formatString.contains("MMMM")) {
            // Full month name
            for (int i = 0; i < 12; i++) {
View Full Code Here

Examples of com.google.gwt.i18n.client.LocaleInfo

     *            Format string e.g. "d M yyyy"
     * @return The date string where the month names have been replaced by the
     *         browser locale version
     */
    private String parseMonthName(String enteredDate, String formatString) {
        LocaleInfo browserLocale = LocaleInfo.getCurrentLocale();
        if (browserLocale.getLocaleName().equals(getLocale())) {
            // No conversion needs to be done when locales match
            return enteredDate;
        }
        String[] browserMonthNames = browserLocale.getDateTimeConstants()
                .months();
        String[] browserShortMonthNames = browserLocale.getDateTimeConstants()
                .shortMonths();

        if (formatString.contains("MMMM")) {
            // Full month name
            for (int i = 0; i < 12; i++) {
View Full Code Here

Examples of com.google.gwt.i18n.client.LocaleInfo

    }


    @Override
    public void switchLocale() {
        LocaleInfo currentLocale = LocaleInfo.getCurrentLocale();

        String newLocale;

        if (currentLocale.getLocaleName().equals("fr")) {
            newLocale = "en";
        } else {
            newLocale = "fr";
        }
       
View Full Code Here

Examples of org.eclipse.wb.internal.core.nls.model.LocaleInfo

        assertEquals(1, locales.length);
        assertEquals("(default)", locales[0].getTitle());
      }
      // add locales
      {
        editableSource.addLocale(new LocaleInfo(new Locale("it")), LocaleInfo.DEFAULT);
        editableSource.addLocale(new LocaleInfo(new Locale("fr")), null);
      }
      // check new locales
      {
        LocaleInfo[] locales = editableSource.getLocales();
        assertEquals(3, locales.length);
        assertEquals("(default)", locales[0].getTitle());
        assertEquals("fr", locales[1].getTitle());
        assertEquals("it", locales[2].getTitle());
      }
      // apply commands
      support.applyEditable(editableSupport);
      // checks
      {
        // *.properties: default
        {
          String newProperties = getFileContentSrc("test/client/MyConstants.properties");
          assertTrue(newProperties.contains("rootPanel_title=My title"));
        }
        // *.properties: fr
        {
          String newProperties = getFileContentSrc("test/client/MyConstants_fr.properties");
          assertFalse(newProperties.contains("rootPanel_title=My title"));
        }
        // *.properties: it
        {
          String newProperties = getFileContentSrc("test/client/MyConstants_it.properties");
          assertTrue(newProperties.contains("rootPanel_title=My title"));
        }
        // module
        {
          String module = getFileContentSrc("test/Module.gwt.xml");
          assertTrue(module.contains("<extend-property name=\"locale\" values=\"fr,it\"/>"));
        }
      }
    }
    //
    // STAGE #2: remove locale
    //
    {
      IEditableSupport editableSupport = support.getEditable();
      IEditableSource editableSource = editableSupport.getEditableSources().get(0);
      // remove locales
      {
        editableSource.removeLocale(new LocaleInfo(new Locale("it")));
        editableSource.removeLocale(new LocaleInfo(new Locale("fr")));
        support.applyEditable(editableSupport);
      }
      // check new locales
      {
        LocaleInfo[] locales = editableSource.getLocales();
View Full Code Here

Examples of org.hyperic.sigar.win32.LocaleInfo

        if (!fqdn.equals(host)) {
            os.println("Hostname............" + host);
        }       

        if (SigarLoader.IS_WIN32) {
            LocaleInfo info = new LocaleInfo();
            os.println("Language............" + info);
            os.println("Perflib lang id....." +
                       info.getPerflibLangId());
        }
    }
View Full Code Here

Examples of org.hyperic.sigar.win32.LocaleInfo

        };

        for (int i=0; i<tests.length; i++) {
            Integer id = (Integer)tests[i][0];
            String lang = (String)tests[i][1];
            LocaleInfo info = new LocaleInfo(id);
            checkInfo(info, lang);
        }

        checkInfo(new LocaleInfo(), "");
    }
View Full Code Here

Examples of org.hyperic.sigar.win32.LocaleInfo

        };

        for (int i=0; i<tests.length; i++) {
            Integer id = (Integer)tests[i][0];
            String lang = (String)tests[i][1];
            LocaleInfo info = new LocaleInfo(id);
            checkInfo(info, lang);
        }

        checkInfo(new LocaleInfo(), "");
    }
View Full Code Here

Examples of org.hyperic.sigar.win32.LocaleInfo

        if (!fqdn.equals(host)) {
            os.println("Hostname............" + host);
        }       

        if (SigarLoader.IS_WIN32) {
            LocaleInfo info = new LocaleInfo();
            os.println("Language............" + info);
            os.println("Perflib lang id....." +
                       info.getPerflibLangId());
        }
    }
View Full Code Here

Examples of org.hyperic.sigar.win32.LocaleInfo

        if (!fqdn.equals(host)) {
            os.println("Hostname............" + host);
        }       

        if (SigarLoader.IS_WIN32) {
            LocaleInfo info = new LocaleInfo();
            os.println("Language............" + info);
            os.println("Perflib lang id....." +
                       info.getPerflibLangId());
        }
    }
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.