All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sdl.selenium.web.utils.internationalization.InternationalizationUtils Maven / Gradle / Ivy

Go to download

Automated Acceptance Testing. Selenium and Selenium WebDriver test framework for web applications. (optimized for dynamic html, ExtJS, Bootstrap, complex UI, simple web applications/sites)

The newest version!
package com.sdl.selenium.web.utils.internationalization;

import java.util.ArrayList;
import java.util.Map;

/**
 * Created by fratiu on 8/2/2016.
 */
public class InternationalizationUtils {

    private static InternationalizedTextRetriever internationalizedTextRetriever = new InternationalizedTextRetriever(false, new ArrayList>(), "");

    /**
     * @param internationalizedTextRetriever is a parameter
     */
    public static void setInternationalizedTextRetriever(InternationalizedTextRetriever internationalizedTextRetriever) {
        InternationalizationUtils.internationalizedTextRetriever = internationalizedTextRetriever;
    }

    public static void setCurrentLanguage(String language) {
        internationalizedTextRetriever.setCurrentLanguage(language);
    }

    public static boolean isInternationalizedTestsSuite() {
        return internationalizedTextRetriever.isInternationalizedTestsSuite();
    }

    public static void setInternationalizedTestsSuite(boolean enabled) {
        internationalizedTextRetriever.setInternationalizedTestsSuite(enabled);
    }

    /**
     * @see InternationalizedTextRetriever#setVariableNotationPatterns(String...)
     * @param variablePatterns variablePatterns
     */
    public static void setVariablePatterns(String... variablePatterns) {
        internationalizedTextRetriever.setVariableNotationPatterns(variablePatterns);
    }

    public static String getInternationalizedText(String text) {
        return internationalizedTextRetriever.getText(text);
    }

    public static String getInternationalizedText(String text, boolean isInternationalized) {
        if (isInternationalized) {
            return internationalizedTextRetriever.getText(text);
        } else {
            return text;
        }
    }

    public static InternationalizedTextRetriever getInternationalizedTextRetriever() {
        return internationalizedTextRetriever;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy