Example usage for com.google.gwt.language.client.translation Language SPANISH

List of usage examples for com.google.gwt.language.client.translation Language SPANISH

Introduction

In this page you can find the example usage for com.google.gwt.language.client.translation Language SPANISH.

Prototype

Language SPANISH

To view the source code for com.google.gwt.language.client.translation Language SPANISH.

Click Source Link

Usage

From source file:com.google.gwt.language.sample.hellolanguage.client.TranslationDemo.java

License:Apache License

/**
 * Populates list boxes with source and destination languages.
 *//*from  ww w .ja va  2 s.co  m*/
private void populateListBoxes() {
    int englishIndex = 0;
    int spanishIndex = 0;
    int iter = 0;

    // Populate source & destination language list boxes.
    for (Language lang : Language.values()) {
        if (!Translation.isTranslatable(lang)) {
            continue;
        }

        sourceLanguages.addItem(lang.toString());
        destinationLanguages.addItem(lang.toString());
        if (lang == Language.ENGLISH) {
            englishIndex = iter;
        } else if (lang == Language.SPANISH) {
            spanishIndex = iter;
        }
        ++iter;
    }

    // Select English as default source and Spanish as default destination
    // languages.
    sourceLanguages.setSelectedIndex(englishIndex);
    destinationLanguages.setSelectedIndex(spanishIndex);
}