Fix unescaping of entities in translator and touch up two typos in BS what's new notes

This commit is contained in:
Sean Owen 2014-02-28 10:34:12 +00:00
parent 01ae1deba6
commit 097934091f
3 changed files with 6 additions and 6 deletions

View file

@ -8,7 +8,7 @@
<body> <body>
<p> Nouveau dans la version 4.6.2: </p> <p> Nouveau dans la version 4.6.2: </p>
<ul> <ul>
<li> orientation de la caméra prend désormais en charge paysage inversé </li> <li> Orientation de la caméra prend désormais en charge paysage inversé </li>
<li> Correction de quelques petits problèmes </li> <li> Correction de quelques petits problèmes </li>
</ul> </ul>
<p>Traduite par Google Translate.</p></body> <p>Traduite par Google Translate.</p></body>

View file

@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
<title> Cosa c&amp;#39;è di nuovo nella Barcode Scanner </title> <title> Cosa c'è di nuovo nella Barcode Scanner </title>
<link href="../style.css" rel="stylesheet" type="text/css"/> <link href="../style.css" rel="stylesheet" type="text/css"/>
</head> </head>
<body> <body>

View file

@ -191,14 +191,14 @@ public final class StringsResourceTranslator {
return english; return english;
} }
String translation = m.group(1); String translation = m.group(1);
System.out.println(" Got translation " + translation);
// This is a little crude; unescape some common escapes in the raw response // This is a little crude; unescape some common escapes in the raw response
translation = translation.replaceAll("\\\\u0026quot;", "\""); translation = translation.replaceAll("&quot;", "\"");
translation = translation.replaceAll("\\\\u0026#39;", "'"); translation = translation.replaceAll("&#39;", "'");
translation = translation.replaceAll("\\\\u200b", "");
translation = translation.replaceAll("&amp;quot;", "\""); translation = translation.replaceAll("&amp;quot;", "\"");
translation = translation.replaceAll("&amp;#39;", "'"); translation = translation.replaceAll("&amp;#39;", "'");
System.out.println(" Got translation " + translation);
return translation; return translation;
} }