package cgeo.geocaching.utils;

import java.net.URLEncoder;

/**
 * Utilities used for translating
 */
public final class TranslationUtils {

    private static final String translationWebsite = "http://translate.google.com/";
    private static final String translationAutoSelect = "#auto";
    private static final String translationFieldSeparator = "|";

    /**
     * Build a URI for Google Translate
     *
     * @param toLang
     *            The two-letter lowercase ISO language codes as defined by ISO 639-1
     * @param text
     *            The text to be translated
     * @return URI ready to be parsed
     */
    public static String buildTranslationURI(final String toLang, final String text) {
        return translationWebsite + translationAutoSelect + translationFieldSeparator + toLang + translationFieldSeparator + URLEncoder.encode(text).replace("+", "%20");
    }

}

Add translation utility class. Adds method to build a URI for Google Translate.
Add translation utility class.
Adds method to build a URI for Google Translate.