Fix problem in translator with %s strings; restore deleted string

git-svn-id: https://zxing.googlecode.com/svn/trunk@1829 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2011-06-21 09:24:00 +00:00
parent a8fe33c862
commit a866e832c9
24 changed files with 56 additions and 28 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">المسح الضوئي وحفظها بشكل مستمر العديد من الرموز الشريطية</string>
<string name="preferences_bulk_mode_title">جل وضع المسح الضوئي</string>
<string name="preferences_copy_to_clipboard_title">نسخ إلى الحافظة</string>
<string name="preferences_custom_product_search_summary" formatted="false">استخدم %s كعنصر نائب لمعرف المنتج</string>
<string name="preferences_custom_product_search_title">عنوان بحث مخصص</string>
<string name="preferences_decode_1D_title">فك الرموز الشريطية 1D</string>
<string name="preferences_decode_Data_Matrix_title">فك رموز البيانات ماتريكس</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Сканирай и запомняй множество баркодове без прекъсване</string>
<string name="preferences_bulk_mode_title">Масово сканиране</string>
<string name="preferences_copy_to_clipboard_title">Копиране в клипборда</string>
<string name="preferences_custom_product_search_summary" formatted="false">Използвайте %s за идентификатора и %f за формата</string>
<string name="preferences_custom_product_search_title">Потребителски адрес за търсене</string>
<string name="preferences_decode_1D_title">1D Баркодове</string>
<string name="preferences_decode_Data_Matrix_title">Data Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Skenování více čárových kódú bez přerušení, vhodné na dávkové zpracování velkého množství čárových kódú</string>
<string name="preferences_bulk_mode_title">Dávkový režim skenování</string>
<string name="preferences_copy_to_clipboard_title">Kopírovat do schránky.</string>
<string name="preferences_custom_product_search_summary" formatted="false">Použijte %s jako zástupný symbol pro ID produktu, a %f pro formát</string>
<string name="preferences_custom_product_search_title">Vlastní vyhledávání URL</string>
<string name="preferences_decode_1D_title">1D kódy</string>
<string name="preferences_decode_Data_Matrix_title">Data Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Scan og gem mange stregkoder uden afbrydelser</string>
<string name="preferences_bulk_mode_title">Massescanningstilstand</string>
<string name="preferences_copy_to_clipboard_title">Kopiér til udklipsholder</string>
<string name="preferences_custom_product_search_summary" formatted="false">Brug %s som en pladsholder for produkt-id, og %f for format</string>
<string name="preferences_custom_product_search_title">Brugerdefineret søge-URL</string>
<string name="preferences_decode_1D_title">Afkod 1D-stregkoder</string>
<string name="preferences_decode_Data_Matrix_title">Afkod Data Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Scannt und speichert mehrere Barcodes nacheinander</string>
<string name="preferences_bulk_mode_title">Bulk-Scan-Modus</string>
<string name="preferences_copy_to_clipboard_title">In Zwischenablage kopieren</string>
<string name="preferences_custom_product_search_summary" formatted="false">Verwenden Sie %s als Platzhalter für die Produkt-ID und %f für das Format</string>
<string name="preferences_custom_product_search_title">Eigene Such-URL</string>
<string name="preferences_decode_1D_title">1D Barcodes</string>
<string name="preferences_decode_Data_Matrix_title">Data Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Escanear y guardar muchos códigos de barras de forma continua</string>
<string name="preferences_bulk_mode_title">Bulk modo de exploración</string>
<string name="preferences_copy_to_clipboard_title">Copiar al portapapeles</string>
<string name="preferences_custom_product_search_summary" formatted="false">Use %s como un marcador de posición para el identificador del producto, y %f para el formato</string>
<string name="preferences_custom_product_search_title">Búsqueda de productos con URL personalizada</string>
<string name="preferences_decode_1D_title">Códigos de barras 1D</string>
<string name="preferences_decode_Data_Matrix_title">Data Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Skannaa ja tallenna monet viivakoodeja jatkuvasti</string>
<string name="preferences_bulk_mode_title">Bulk skannaustilassa</string>
<string name="preferences_copy_to_clipboard_title">Kopioi leikepöydälle</string>
<string name="preferences_custom_product_search_summary" formatted="false">Käytä %s paikkana tuotetunnukselle tunnus ja %f muoto</string>
<string name="preferences_custom_product_search_title">Mukautettu hakukone</string>
<string name="preferences_decode_1D_title">1D viivakoodeja</string>
<string name="preferences_decode_Data_Matrix_title">Data Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Scanner et enregistrer plusieurs codes-barres d\'affilée</string>
<string name="preferences_bulk_mode_title">Mode de lecture en rafale</string>
<string name="preferences_copy_to_clipboard_title">Copier dans le presse papier</string>
<string name="preferences_custom_product_search_summary" formatted="false">Utiliser %s à la place de l\'identifiant du produit, et %f pour le format</string>
<string name="preferences_custom_product_search_title">URL de recherche personnalisée</string>
<string name="preferences_decode_1D_title">Unidimensionnels (1D)</string>
<string name="preferences_decode_Data_Matrix_title">Data Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">סורק ושומר ברקודים באופן רציף</string>
<string name="preferences_bulk_mode_title">מצב סריקה מרובה</string>
<string name="preferences_copy_to_clipboard_title">העתק ללוח</string>
<string name="preferences_custom_product_search_summary" formatted="false">השתמש ב- %s כמציין מיקום עבור מזהה המוצר, וב- %f עבור הפורמט</string>
<string name="preferences_custom_product_search_title">כתובת לחיפוש מותאם אישית</string>
<string name="preferences_decode_1D_title">ברקודים חד מימדיים</string>
<string name="preferences_decode_Data_Matrix_title">מטריצת נתונים</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Beolvasni és elmenteni több vonalkód folyamatosan</string>
<string name="preferences_bulk_mode_title">Tömeges scan üzemmód</string>
<string name="preferences_copy_to_clipboard_title">Másolás a vágólapra</string>
<string name="preferences_custom_product_search_summary" formatted="false">Használja a %s helyktöltést a termék azonosító helyén, és %f esetében formátum</string>
<string name="preferences_custom_product_search_title">Egyedi keresés URL</string>
<string name="preferences_decode_1D_title">1D vonalkódok</string>
<string name="preferences_decode_Data_Matrix_title">Data Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Scansiona e salva diversi codici a barre in sequenza</string>
<string name="preferences_bulk_mode_title">Modalità scansione di gruppo</string>
<string name="preferences_copy_to_clipboard_title">Copia negli appunti</string>
<string name="preferences_custom_product_search_summary" formatted="false">Utilizza %s come segnalibro per l\'ID del prodotto e %f per il formato</string>
<string name="preferences_custom_product_search_title">URL ricerca personalizzata</string>
<string name="preferences_decode_1D_title">Codice a barre 1D</string>
<string name="preferences_decode_Data_Matrix_title">Matrice dati</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">多くのバーコード連続してスキャンし、保存する</string>
<string name="preferences_bulk_mode_title">連続モードでのスキャン</string>
<string name="preferences_copy_to_clipboard_title">クリップボードにコピーする</string>
<string name="preferences_custom_product_search_summary" formatted="false">URL中の「%s」はスキャン結果に置換されます</string>
<string name="preferences_custom_product_search_title">カスタム商品サーチ URL</string>
<string name="preferences_decode_1D_title">1Dバーコードを読み取る</string>
<string name="preferences_decode_Data_Matrix_title">データマトリックスコードを読み取る</string>
@ -126,7 +127,7 @@
<string name="result_wifi">ネットワーク構成がヒットしました</string>
<string name="sbc_name">Google ブックス</string>
<string name="share_name">バーコードで共有する</string>
<string name="title_about">>QRコードスキャナー v</string>
<string name="title_about">QRコードスキャナー v</string>
<string name="wa_name">ネットワーク構成</string>
<string name="wifi_changing_network">ネットワークを変更する</string>
<string name="wifi_connect_failed">ネットワーク接続が失敗しました。</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">다수의 바코드를 스캔하고 저장합니다.</string>
<string name="preferences_bulk_mode_title">일괄 스캔 모드</string>
<string name="preferences_copy_to_clipboard_title">복사하기</string>
<string name="preferences_custom_product_search_summary" formatted="false">%s를 제품 ID로, %f를 포맷으로 입력하여 주세요.</string>
<string name="preferences_custom_product_search_title">사용자 지정 검색 주소</string>
<string name="preferences_decode_1D_title">1차원 바코드를 읽기</string>
<string name="preferences_decode_Data_Matrix_title">데이터 행렬(Data Matrix)을 해석하기</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Scan continue barcodes en sla ze allemaal op</string>
<string name="preferences_bulk_mode_title">Bulk scan modus</string>
<string name="preferences_copy_to_clipboard_title">Kopieer naar plakbord</string>
<string name="preferences_custom_product_search_summary" formatted="false">Gebruik %s voor de plaats van het product ID en %f voor het formaat</string>
<string name="preferences_custom_product_search_title">Zoek aangepaste URL</string>
<string name="preferences_decode_1D_title">1D barcodes</string>
<string name="preferences_decode_Data_Matrix_title">Data Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Skanowanie i zapisywanie wielu kodów kreskowych ciągle</string>
<string name="preferences_bulk_mode_title">Luzem tryb skanowania</string>
<string name="preferences_copy_to_clipboard_title">Kopiuj do schowka</string>
<string name="preferences_custom_product_search_summary" formatted="false">Użyj %s jako zamiennik dla ID produktu, a dla formatu %f</string>
<string name="preferences_custom_product_search_title">Własny URL wyszukiwania</string>
<string name="preferences_decode_1D_title">Dekoduj kody 1D</string>
<string name="preferences_decode_Data_Matrix_title">Dekoduj Decode Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Digitalizar e salvar muitas barras continuamente</string>
<string name="preferences_bulk_mode_title">Bulk modo de digitalização</string>
<string name="preferences_copy_to_clipboard_title">Copiar para a área de transferência</string>
<string name="preferences_custom_product_search_summary" formatted="false">Use %s como um espaço reservado para a identificação do produto, e para o formato %f</string>
<string name="preferences_custom_product_search_title">URL de pesquisa personalizada </string>
<string name="preferences_decode_1D_title">Código de barras 1D</string>
<string name="preferences_decode_Data_Matrix_title">Data Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Постоянно сканировать и сохранять штрих-коды</string>
<string name="preferences_bulk_mode_title">Массовое сканирование</string>
<string name="preferences_copy_to_clipboard_title">Копировать в буфер обмена</string>
<string name="preferences_custom_product_search_summary" formatted="false">%s будет заменён на ID товара, и %f на формат</string>
<string name="preferences_custom_product_search_title">URL пользовательского поиска</string>
<string name="preferences_decode_1D_title">Распознавать линейные штрих-коды</string>
<string name="preferences_decode_Data_Matrix_title">Распознавать Data Matrix</string>

View file

@ -95,7 +95,7 @@
<string name="preferences_bulk_mode_summary">Skenovať a ukladať veľa čiarových kódov bez prerušenia</string>
<string name="preferences_bulk_mode_title">Hromadný režim skenovania</string>
<string name="preferences_copy_to_clipboard_title">Kopírovať do schránky</string>
<string name="preferences_custom_product_search_summary" formatted="false">Použitie %s ako zástupný symbol pre ID produktu, a %f pre formát</string>
<string name="preferences_custom_product_search_summary">Použiť ako vlastníka pre ID produktu, a pre formát</string>
<string name="preferences_custom_product_search_title">Vlastné vyhľadávanie URL</string>
<string name="preferences_decode_1D_title">1D čiarové kódy</string>
<string name="preferences_decode_Data_Matrix_title">Dáta Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Beri in shrani več črtnih kod zaporedoma</string>
<string name="preferences_bulk_mode_title">Branje črtnih kod na debelo</string>
<string name="preferences_copy_to_clipboard_title">Kopiraj v beležnico</string>
<string name="preferences_custom_product_search_summary" formatted="false">Uporabi %s kot prostor za ID produkta ter %f za format</string>
<string name="preferences_custom_product_search_title">URL za iskanje po meri</string>
<string name="preferences_decode_1D_title">1D črtno kodo</string>
<string name="preferences_decode_Data_Matrix_title">Data Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Skanna och spara många streckkoder kontinuerligt</string>
<string name="preferences_bulk_mode_title">Bulk skanningsläget</string>
<string name="preferences_copy_to_clipboard_title">Kopiera till klippbordet</string>
<string name="preferences_custom_product_search_summary" formatted="false">Skriv %s där produktens ID ska placeras, och %f för format</string>
<string name="preferences_custom_product_search_title">Anpassad sök-URL</string>
<string name="preferences_decode_1D_title">1D steckkod</string>
<string name="preferences_decode_Data_Matrix_title">Data Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">Birden fazla barkodu toplu olarak taramak ve kaydetmek için</string>
<string name="preferences_bulk_mode_title">Toplu tarama modu</string>
<string name="preferences_copy_to_clipboard_title">Panoya kopyala</string>
<string name="preferences_custom_product_search_summary" formatted="false">Yer tutucu olarak ürün kimliği için %s, biçim için %f öğesini kullan</string>
<string name="preferences_custom_product_search_title">Özel arama adresi</string>
<string name="preferences_decode_1D_title">1D barkodları</string>
<string name="preferences_decode_Data_Matrix_title">Data Matrix</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">连续扫描并保存多个条形码</string>
<string name="preferences_bulk_mode_title">批量扫描模式</string>
<string name="preferences_copy_to_clipboard_title">复制到剪切板</string>
<string name="preferences_custom_product_search_summary" formatted="false">使用%s作为产品ID占位符</string>
<string name="preferences_custom_product_search_title">自定义搜索网址</string>
<string name="preferences_decode_1D_title">扫描 一维条码</string>
<string name="preferences_decode_Data_Matrix_title">扫描 DM码</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 ZXing authors
Copyright (C) 2011 ZXing authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -95,6 +95,7 @@
<string name="preferences_bulk_mode_summary">條碼掃描和挽救了許多人不斷</string>
<string name="preferences_bulk_mode_title">批量掃描模式</string>
<string name="preferences_copy_to_clipboard_title">復製到剪貼簿</string>
<string name="preferences_custom_product_search_summary" formatted="false">使用s作為佔位符的產品ID</string>
<string name="preferences_custom_product_search_title">自定義搜索網址</string>
<string name="preferences_decode_1D_title">解碼一維條碼</string>
<string name="preferences_decode_Data_Matrix_title">數據矩陣碼解碼</string>

View file

@ -52,14 +52,14 @@ import java.util.regex.Pattern;
public final class StringsResourceTranslator {
private static final Charset UTF8 = Charset.forName("UTF-8");
private static final Pattern ENTRY_PATTERN = Pattern.compile("<string name=\"([^\"]+)\">([^<]+)</string>");
private static final Pattern ENTRY_PATTERN = Pattern.compile("<string name=\"([^\"]+)\".*>([^<]+)</string>");
private static final Pattern STRINGS_FILE_NAME_PATTERN = Pattern.compile("values-(.+)");
private static final Pattern TRANSLATE_RESPONSE_PATTERN = Pattern.compile(
"\\{\"translatedText\":\"([^\"]+)\"\\}");
private static final String APACHE_2_LICENSE =
"<!--\n" +
" Copyright (C) 2010 ZXing authors\n" +
" Copyright (C) 2011 ZXing authors\n" +
'\n' +
" Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
" you may not use this file except in compliance with the License.\n" +
@ -132,14 +132,20 @@ public final class StringsResourceTranslator {
for (Map.Entry<String,String> englishEntry : english.entrySet()) {
String key = englishEntry.getKey();
String value = englishEntry.getValue();
out.write(" <string name=\"");
out.write(key);
out.write("\">");
out.write('"');
if (value.contains("%s") || value.contains("%f")) {
// Need to specify that there's a value placeholder
out.write(" formatted=\"false\"");
}
out.write('>');
String translatedString = translated.get(key);
if (translatedString == null || forceRetranslation.contains(key)) {
anyChange = true;
translatedString = translateString(englishEntry.getValue(), language);
translatedString = translateString(value, language);
}
out.write(translatedString);