diff options
author | Buuhuu <diru91@googlemail.com> | 2012-08-09 00:45:55 +0200 |
---|---|---|
committer | Buuhuu <diru91@googlemail.com> | 2012-08-09 00:45:55 +0200 |
commit | 501fd91ca3e9fa876ba8493b21ec9a2c08e1d893 (patch) | |
tree | 1da99c5779f6972407d576963b32ac78bee7cc14 | |
parent | 1c27141a59b6603efc1d69e60bece5234df1d07f (diff) | |
download | cgeo-501fd91ca3e9fa876ba8493b21ec9a2c08e1d893.zip cgeo-501fd91ca3e9fa876ba8493b21ec9a2c08e1d893.tar.gz cgeo-501fd91ca3e9fa876ba8493b21ec9a2c08e1d893.tar.bz2 |
Used Android's Html class to convert HTML formated text to contentual string only.
-rw-r--r-- | main/src/cgeo/geocaching/utils/TranslationUtils.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/utils/TranslationUtils.java b/main/src/cgeo/geocaching/utils/TranslationUtils.java index e086ab6..5e5bb4b 100644 --- a/main/src/cgeo/geocaching/utils/TranslationUtils.java +++ b/main/src/cgeo/geocaching/utils/TranslationUtils.java @@ -4,6 +4,7 @@ import cgeo.geocaching.activity.AbstractActivity; import android.content.Intent; import android.net.Uri; +import android.text.Html; import java.net.URLEncoder; @@ -15,7 +16,7 @@ public final class TranslationUtils { private static final String translationWebsite = "http://translate.google.com/"; private static final String translationForceClassicMode = "?vi=c"; private static final String translationAutoSelect = "#auto"; - private static final String translationFieldSeparator = "|"; + private static final String translationFieldSeparator = "/"; public static final int translationTextLengthToWarn = 500; @@ -29,7 +30,7 @@ public final class TranslationUtils { * @return URI ready to be parsed */ public static String buildTranslationURI(final String toLang, final String text) { - return translationWebsite + translationForceClassicMode + translationAutoSelect + translationFieldSeparator + toLang + translationFieldSeparator + URLEncoder.encode(text).replace("+", "%20"); + return translationWebsite + translationForceClassicMode + translationAutoSelect + translationFieldSeparator + toLang + translationFieldSeparator + URLEncoder.encode(Html.fromHtml(text).toString()).replace("+", "%20"); } /** |