Skip to content

Commit

Permalink
Fix unescaping of entities in translator and touch up two typos in BS…
Browse files Browse the repository at this point in the history
… what's new notes
  • Loading branch information
srowen committed Feb 28, 2014
1 parent 01ae1de commit 0979340
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion android/assets/html-fr/whatsnew.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>
<p> Nouveau dans la version 4.6.2: </p>
<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>
</ul>
<p>Traduite par Google Translate.</p></body>
Expand Down
2 changes: 1 addition & 1 deletion android/assets/html-it/whatsnew.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<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"/>
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ static String translateString(String english, String language) throws IOExceptio
return english;
}
String translation = m.group(1);
System.out.println(" Got translation " + translation);

// This is a little crude; unescape some common escapes in the raw response
translation = translation.replaceAll("\\\\u0026quot;", "\"");
translation = translation.replaceAll("\\\\u0026#39;", "'");
translation = translation.replaceAll("\\\\u200b", "");
translation = translation.replaceAll("&quot;", "\"");
translation = translation.replaceAll("&#39;", "'");
translation = translation.replaceAll("&amp;quot;", "\"");
translation = translation.replaceAll("&amp;#39;", "'");

System.out.println(" Got translation " + translation);
return translation;
}

Expand Down

0 comments on commit 0979340

Please sign in to comment.