diff --git a/tools/recovery_l10n/Android.mk b/tools/recovery_l10n/Android.mk
new file mode 100644
index 00000000..937abd1e
--- /dev/null
+++ b/tools/recovery_l10n/Android.mk
@@ -0,0 +1,12 @@
+# Copyright 2012 Google Inc. All Rights Reserved.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_PACKAGE_NAME := RecoveryLocalizer
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+include $(BUILD_PACKAGE)
diff --git a/tools/recovery_l10n/AndroidManifest.xml b/tools/recovery_l10n/AndroidManifest.xml
new file mode 100644
index 00000000..8c51a4e0
--- /dev/null
+++ b/tools/recovery_l10n/AndroidManifest.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tools/recovery_l10n/res/layout/main.xml b/tools/recovery_l10n/res/layout/main.xml
new file mode 100644
index 00000000..0900b110
--- /dev/null
+++ b/tools/recovery_l10n/res/layout/main.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tools/recovery_l10n/res/values-af/strings.xml b/tools/recovery_l10n/res/values-af/strings.xml
new file mode 100644
index 00000000..d5264184
--- /dev/null
+++ b/tools/recovery_l10n/res/values-af/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Installeer tans stelselopdatering..."
+ "Vee tans uit..."
+ "Geen bevel."
+ "Fout!"
+
diff --git a/tools/recovery_l10n/res/values-am/strings.xml b/tools/recovery_l10n/res/values-am/strings.xml
new file mode 100644
index 00000000..cddb099b
--- /dev/null
+++ b/tools/recovery_l10n/res/values-am/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "የስርዓት ዝማኔ በመጫን ላይ…"
+ "በመደምሰስ ላይ…"
+ "ምንም ትዕዛዝ የለም።"
+ "ስህተት!"
+
diff --git a/tools/recovery_l10n/res/values-ar/strings.xml b/tools/recovery_l10n/res/values-ar/strings.xml
new file mode 100644
index 00000000..d06b9664
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ar/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "جارٍ تثبيت تحديث النظام…"
+ "جارٍ المسح…"
+ "ليس هناك أي أمر."
+ "خطأ!"
+
diff --git a/tools/recovery_l10n/res/values-az-rAZ/strings.xml b/tools/recovery_l10n/res/values-az-rAZ/strings.xml
new file mode 100644
index 00000000..3435573d
--- /dev/null
+++ b/tools/recovery_l10n/res/values-az-rAZ/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Sistem güncəlləməsi quraşdırılır..."
+ "Silinir..."
+ "Əmr yoxdur."
+ "Xəta!"
+
diff --git a/tools/recovery_l10n/res/values-bg/strings.xml b/tools/recovery_l10n/res/values-bg/strings.xml
new file mode 100644
index 00000000..004f3b93
--- /dev/null
+++ b/tools/recovery_l10n/res/values-bg/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Системната актуализация се инсталира…"
+ "Изтрива се…"
+ "Без команда."
+ "Грешка!"
+
diff --git a/tools/recovery_l10n/res/values-bn-rBD/strings.xml b/tools/recovery_l10n/res/values-bn-rBD/strings.xml
new file mode 100644
index 00000000..4d2e590f
--- /dev/null
+++ b/tools/recovery_l10n/res/values-bn-rBD/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "সিস্টেম আপডেট ইনস্টল করা হচ্ছে…"
+ "মোছা হচ্ছে…"
+ "কোনো নির্দেশ নেই।"
+ "ত্রুটি!"
+
diff --git a/tools/recovery_l10n/res/values-ca/strings.xml b/tools/recovery_l10n/res/values-ca/strings.xml
new file mode 100644
index 00000000..5d7b652c
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ca/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "S\'està instal·lant l\'actualització del sistema..."
+ "S\'està esborrant..."
+ "Cap ordre."
+ "Error!"
+
diff --git a/tools/recovery_l10n/res/values-cs/strings.xml b/tools/recovery_l10n/res/values-cs/strings.xml
new file mode 100644
index 00000000..771235d0
--- /dev/null
+++ b/tools/recovery_l10n/res/values-cs/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Instalace aktualizace systému..."
+ "Mazání…"
+ "Žádný příkaz."
+ "Chyba!"
+
diff --git a/tools/recovery_l10n/res/values-da/strings.xml b/tools/recovery_l10n/res/values-da/strings.xml
new file mode 100644
index 00000000..c28a76fb
--- /dev/null
+++ b/tools/recovery_l10n/res/values-da/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Systemopdateringen installeres…"
+ "Sletter…"
+ "Ingen kommando."
+ "Fejl!"
+
diff --git a/tools/recovery_l10n/res/values-de/strings.xml b/tools/recovery_l10n/res/values-de/strings.xml
new file mode 100644
index 00000000..02d25905
--- /dev/null
+++ b/tools/recovery_l10n/res/values-de/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Systemupdate wird installiert…"
+ "Wird gelöscht…"
+ "Kein Befehl"
+ "Fehler"
+
diff --git a/tools/recovery_l10n/res/values-el/strings.xml b/tools/recovery_l10n/res/values-el/strings.xml
new file mode 100644
index 00000000..aa2626b4
--- /dev/null
+++ b/tools/recovery_l10n/res/values-el/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Εγκατάσταση ενημέρωσης συστήματος…"
+ "Διαγραφή…"
+ "Καμία εντολή."
+ "Σφάλμα!"
+
diff --git a/tools/recovery_l10n/res/values-en-rAU/strings.xml b/tools/recovery_l10n/res/values-en-rAU/strings.xml
new file mode 100644
index 00000000..b70d678c
--- /dev/null
+++ b/tools/recovery_l10n/res/values-en-rAU/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Installing system update…"
+ "Erasing…"
+ "No command."
+ "Error!"
+
diff --git a/tools/recovery_l10n/res/values-en-rGB/strings.xml b/tools/recovery_l10n/res/values-en-rGB/strings.xml
new file mode 100644
index 00000000..b70d678c
--- /dev/null
+++ b/tools/recovery_l10n/res/values-en-rGB/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Installing system update…"
+ "Erasing…"
+ "No command."
+ "Error!"
+
diff --git a/tools/recovery_l10n/res/values-en-rIN/strings.xml b/tools/recovery_l10n/res/values-en-rIN/strings.xml
new file mode 100644
index 00000000..b70d678c
--- /dev/null
+++ b/tools/recovery_l10n/res/values-en-rIN/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Installing system update…"
+ "Erasing…"
+ "No command."
+ "Error!"
+
diff --git a/tools/recovery_l10n/res/values-es-rUS/strings.xml b/tools/recovery_l10n/res/values-es-rUS/strings.xml
new file mode 100644
index 00000000..256272ac
--- /dev/null
+++ b/tools/recovery_l10n/res/values-es-rUS/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Instalando actualización del sistema…"
+ "Borrando…"
+ "Ningún comando"
+ "Error"
+
diff --git a/tools/recovery_l10n/res/values-es/strings.xml b/tools/recovery_l10n/res/values-es/strings.xml
new file mode 100644
index 00000000..323f0550
--- /dev/null
+++ b/tools/recovery_l10n/res/values-es/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Instalando actualización del sistema…"
+ "Borrando…"
+ "Sin comandos"
+ "Error"
+
diff --git a/tools/recovery_l10n/res/values-et-rEE/strings.xml b/tools/recovery_l10n/res/values-et-rEE/strings.xml
new file mode 100644
index 00000000..407a53d6
--- /dev/null
+++ b/tools/recovery_l10n/res/values-et-rEE/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Süsteemivärskenduste installimine ..."
+ "Kustutamine ..."
+ "Käsk puudub."
+ "Viga!"
+
diff --git a/tools/recovery_l10n/res/values-eu-rES/strings.xml b/tools/recovery_l10n/res/values-eu-rES/strings.xml
new file mode 100644
index 00000000..08d9c067
--- /dev/null
+++ b/tools/recovery_l10n/res/values-eu-rES/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Sistemaren eguneratzea instalatzen…"
+ "Ezabatzen…"
+ "Ez dago agindurik."
+ "Errorea!"
+
diff --git a/tools/recovery_l10n/res/values-fa/strings.xml b/tools/recovery_l10n/res/values-fa/strings.xml
new file mode 100644
index 00000000..dd002fac
--- /dev/null
+++ b/tools/recovery_l10n/res/values-fa/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "در حال نصب بهروزرسانی سیستم ..."
+ "پاک کردن..."
+ "فرمانی موجود نیست."
+ "خطا!"
+
diff --git a/tools/recovery_l10n/res/values-fi/strings.xml b/tools/recovery_l10n/res/values-fi/strings.xml
new file mode 100644
index 00000000..b77417a9
--- /dev/null
+++ b/tools/recovery_l10n/res/values-fi/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Asennetaan järjestelmäpäivitystä..."
+ "Tyhjennetään..."
+ "Ei komentoa."
+ "Virhe!"
+
diff --git a/tools/recovery_l10n/res/values-fr-rCA/strings.xml b/tools/recovery_l10n/res/values-fr-rCA/strings.xml
new file mode 100644
index 00000000..f2a85d86
--- /dev/null
+++ b/tools/recovery_l10n/res/values-fr-rCA/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Installation de la mise à jour du système en cours…"
+ "Effacement en cours…"
+ "Aucune commande."
+ "Erreur!"
+
diff --git a/tools/recovery_l10n/res/values-fr/strings.xml b/tools/recovery_l10n/res/values-fr/strings.xml
new file mode 100644
index 00000000..cdb4a266
--- /dev/null
+++ b/tools/recovery_l10n/res/values-fr/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Installation de la mise à jour du système en cours…"
+ "Effacement en cours…"
+ "Aucune commande."
+ "Erreur !"
+
diff --git a/tools/recovery_l10n/res/values-gl-rES/strings.xml b/tools/recovery_l10n/res/values-gl-rES/strings.xml
new file mode 100644
index 00000000..7546fbda
--- /dev/null
+++ b/tools/recovery_l10n/res/values-gl-rES/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Instalando actualización do sistema..."
+ "Borrando..."
+ "Ningún comando"
+ "Erro"
+
diff --git a/tools/recovery_l10n/res/values-gu-rIN/strings.xml b/tools/recovery_l10n/res/values-gu-rIN/strings.xml
new file mode 100644
index 00000000..a364b523
--- /dev/null
+++ b/tools/recovery_l10n/res/values-gu-rIN/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "સિસ્ટમ અપડેટ ઇન્સ્ટોલ કરી રહ્યાં છે…"
+ "કાઢી નાખી રહ્યાં છે…"
+ "કોઈ આદેશ નથી."
+ "ભૂલ!"
+
diff --git a/tools/recovery_l10n/res/values-hi/strings.xml b/tools/recovery_l10n/res/values-hi/strings.xml
new file mode 100644
index 00000000..a470d12b
--- /dev/null
+++ b/tools/recovery_l10n/res/values-hi/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "सिस्टम के बारे में नई जानकारी मिल रही है…"
+ "मिटा रहा है…"
+ "कोई आदेश नहीं."
+ "त्रुटि!"
+
diff --git a/tools/recovery_l10n/res/values-hr/strings.xml b/tools/recovery_l10n/res/values-hr/strings.xml
new file mode 100644
index 00000000..56225c01
--- /dev/null
+++ b/tools/recovery_l10n/res/values-hr/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Instaliranje ažuriranja sustava…"
+ "Brisanje…"
+ "Nema naredbe."
+ "Pogreška!"
+
diff --git a/tools/recovery_l10n/res/values-hu/strings.xml b/tools/recovery_l10n/res/values-hu/strings.xml
new file mode 100644
index 00000000..a64f5017
--- /dev/null
+++ b/tools/recovery_l10n/res/values-hu/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Rendszerfrissítés telepítése..."
+ "Törlés..."
+ "Nincs parancs."
+ "Hiba!"
+
diff --git a/tools/recovery_l10n/res/values-hy-rAM/strings.xml b/tools/recovery_l10n/res/values-hy-rAM/strings.xml
new file mode 100644
index 00000000..7babe80c
--- /dev/null
+++ b/tools/recovery_l10n/res/values-hy-rAM/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Համակարգի թարմացման տեղադրում…"
+ "Ջնջում…"
+ "Հրամանը տրված չէ:"
+ "Սխալ"
+
diff --git a/tools/recovery_l10n/res/values-in/strings.xml b/tools/recovery_l10n/res/values-in/strings.xml
new file mode 100644
index 00000000..93f9c287
--- /dev/null
+++ b/tools/recovery_l10n/res/values-in/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Memasang pembaruan sistem…"
+ "Menghapus..."
+ "Tidak ada perintah."
+ "Kesalahan!"
+
diff --git a/tools/recovery_l10n/res/values-is-rIS/strings.xml b/tools/recovery_l10n/res/values-is-rIS/strings.xml
new file mode 100644
index 00000000..926e8513
--- /dev/null
+++ b/tools/recovery_l10n/res/values-is-rIS/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Setur upp kerfisuppfærslu…"
+ "Þurrkar út…"
+ "Engin skipun."
+ "Villa!"
+
diff --git a/tools/recovery_l10n/res/values-it/strings.xml b/tools/recovery_l10n/res/values-it/strings.xml
new file mode 100644
index 00000000..9defe36b
--- /dev/null
+++ b/tools/recovery_l10n/res/values-it/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Installazione aggiornamento di sistema…"
+ "Cancellazione…"
+ "Nessun comando."
+ "Errore!"
+
diff --git a/tools/recovery_l10n/res/values-iw/strings.xml b/tools/recovery_l10n/res/values-iw/strings.xml
new file mode 100644
index 00000000..e43bb20a
--- /dev/null
+++ b/tools/recovery_l10n/res/values-iw/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "מתקין עדכון מערכת…"
+ "מוחק…"
+ "אין פקודה."
+ "שגיאה!"
+
diff --git a/tools/recovery_l10n/res/values-ja/strings.xml b/tools/recovery_l10n/res/values-ja/strings.xml
new file mode 100644
index 00000000..da0fa623
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ja/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "システムアップデートをインストールしています…"
+ "消去しています…"
+ "コマンドが指定されていません。"
+ "エラーです"
+
diff --git a/tools/recovery_l10n/res/values-ka-rGE/strings.xml b/tools/recovery_l10n/res/values-ka-rGE/strings.xml
new file mode 100644
index 00000000..2d27c179
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ka-rGE/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "სისტემის განახლების დაყენება…"
+ "მიმდინარეობს წაშლა…"
+ "ბრძანება არ არის."
+ "შეცდომა!"
+
diff --git a/tools/recovery_l10n/res/values-kk-rKZ/strings.xml b/tools/recovery_l10n/res/values-kk-rKZ/strings.xml
new file mode 100644
index 00000000..3ca05b9e
--- /dev/null
+++ b/tools/recovery_l10n/res/values-kk-rKZ/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Жүйе жаңартуларын орнатуда…"
+ "Өшіруде..."
+ "Пәрмен берілген жоқ."
+ "Қате!"
+
diff --git a/tools/recovery_l10n/res/values-km-rKH/strings.xml b/tools/recovery_l10n/res/values-km-rKH/strings.xml
new file mode 100644
index 00000000..0c1c272e
--- /dev/null
+++ b/tools/recovery_l10n/res/values-km-rKH/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "កំពុងដំឡើងបច្ចុប្បន្នភាពប្រព័ន្ធ…"
+ "កំពុងលុប…"
+ "គ្មានពាក្យបញ្ជា។"
+ "កំហុស!"
+
diff --git a/tools/recovery_l10n/res/values-kn-rIN/strings.xml b/tools/recovery_l10n/res/values-kn-rIN/strings.xml
new file mode 100644
index 00000000..be25d7a9
--- /dev/null
+++ b/tools/recovery_l10n/res/values-kn-rIN/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "ಸಿಸ್ಟಂ ನವೀಕರಣವನ್ನು ಸ್ಥಾಪಿಸಲಾಗುತ್ತಿದೆ…"
+ "ಅಳಿಸಲಾಗುತ್ತಿದೆ…"
+ "ಯಾವುದೇ ಆದೇಶವಿಲ್ಲ."
+ "ದೋಷ!"
+
diff --git a/tools/recovery_l10n/res/values-ko/strings.xml b/tools/recovery_l10n/res/values-ko/strings.xml
new file mode 100644
index 00000000..e46a8760
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ko/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "시스템 업데이트 설치 중…"
+ "지우는 중…"
+ "명령어가 없습니다."
+ "오류!"
+
diff --git a/tools/recovery_l10n/res/values-ky-rKG/strings.xml b/tools/recovery_l10n/res/values-ky-rKG/strings.xml
new file mode 100644
index 00000000..e2ced27a
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ky-rKG/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Системдик жаңыртууларды орнотуу…"
+ "Өчүрүлүүдө…"
+ "Буйрук берилген жок."
+ "Ката!"
+
diff --git a/tools/recovery_l10n/res/values-lo-rLA/strings.xml b/tools/recovery_l10n/res/values-lo-rLA/strings.xml
new file mode 100644
index 00000000..5880cca7
--- /dev/null
+++ b/tools/recovery_l10n/res/values-lo-rLA/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "ກຳລັງຕິດຕັ້ງການອັບເດດລະບົບ..."
+ "ກຳລັງລຶບ..."
+ "ບໍ່ມີຄຳສັ່ງ."
+ "ຜິດພາດ!"
+
diff --git a/tools/recovery_l10n/res/values-lt/strings.xml b/tools/recovery_l10n/res/values-lt/strings.xml
new file mode 100644
index 00000000..957ac755
--- /dev/null
+++ b/tools/recovery_l10n/res/values-lt/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Diegiamas sistemos naujinys…"
+ "Ištrinama…"
+ "Nėra komandos."
+ "Klaida!"
+
diff --git a/tools/recovery_l10n/res/values-lv/strings.xml b/tools/recovery_l10n/res/values-lv/strings.xml
new file mode 100644
index 00000000..c5d5b93a
--- /dev/null
+++ b/tools/recovery_l10n/res/values-lv/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Notiek sistēmas atjauninājuma instalēšana..."
+ "Notiek dzēšana..."
+ "Nav nevienas komandas."
+ "Kļūda!"
+
diff --git a/tools/recovery_l10n/res/values-mk-rMK/strings.xml b/tools/recovery_l10n/res/values-mk-rMK/strings.xml
new file mode 100644
index 00000000..d91a67ca
--- /dev/null
+++ b/tools/recovery_l10n/res/values-mk-rMK/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Се инсталира ажурирање на системот..."
+ "Се брише..."
+ "Нема наредба."
+ "Грешка!"
+
diff --git a/tools/recovery_l10n/res/values-ml-rIN/strings.xml b/tools/recovery_l10n/res/values-ml-rIN/strings.xml
new file mode 100644
index 00000000..38ebcd12
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ml-rIN/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "സിസ്റ്റം അപ്ഡേറ്റ് ഇൻസ്റ്റാളുചെയ്യുന്നു…"
+ "മായ്ക്കുന്നു…"
+ "കമാൻഡ് ഒന്നുമില്ല."
+ "പിശക്!"
+
diff --git a/tools/recovery_l10n/res/values-mn-rMN/strings.xml b/tools/recovery_l10n/res/values-mn-rMN/strings.xml
new file mode 100644
index 00000000..463cafea
--- /dev/null
+++ b/tools/recovery_l10n/res/values-mn-rMN/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Системийн шинэчлэлтийг суулгаж байна…"
+ "Арилгаж байна…"
+ "Команд байхгүй."
+ "Алдаа!"
+
diff --git a/tools/recovery_l10n/res/values-mr-rIN/strings.xml b/tools/recovery_l10n/res/values-mr-rIN/strings.xml
new file mode 100644
index 00000000..25c5d0c5
--- /dev/null
+++ b/tools/recovery_l10n/res/values-mr-rIN/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "सिस्टम अद्यतन स्थापित करीत आहे..."
+ "मिटवित आहे…"
+ "कोणताही आदेश नाही."
+ "त्रुटी!"
+
diff --git a/tools/recovery_l10n/res/values-ms-rMY/strings.xml b/tools/recovery_l10n/res/values-ms-rMY/strings.xml
new file mode 100644
index 00000000..f5635910
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ms-rMY/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Memasang kemas kini sistem..."
+ "Memadam..."
+ "Tiada arahan."
+ "Ralat!"
+
diff --git a/tools/recovery_l10n/res/values-my-rMM/strings.xml b/tools/recovery_l10n/res/values-my-rMM/strings.xml
new file mode 100644
index 00000000..4091b192
--- /dev/null
+++ b/tools/recovery_l10n/res/values-my-rMM/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "စနစ်အား အဆင့်မြှင့်ခြင်း လုပ်ဆောင်နေသည်…"
+ "ဖျက်နေသည် ..."
+ "ညွှန်ကြားချက်မပေးထားပါ"
+ "မှားနေပါသည်!"
+
diff --git a/tools/recovery_l10n/res/values-nb/strings.xml b/tools/recovery_l10n/res/values-nb/strings.xml
new file mode 100644
index 00000000..4e89ad7c
--- /dev/null
+++ b/tools/recovery_l10n/res/values-nb/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Installerer systemoppdateringen ..."
+ "Sletter ..."
+ "Ingen kommando."
+ "Feil!"
+
diff --git a/tools/recovery_l10n/res/values-ne-rNP/strings.xml b/tools/recovery_l10n/res/values-ne-rNP/strings.xml
new file mode 100644
index 00000000..835f275b
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ne-rNP/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "प्रणाली अद्यावधिक स्थापना गर्दै..."
+ "मेटाइदै..."
+ "कुनै आदेश छैन।"
+ "त्रुटि!"
+
diff --git a/tools/recovery_l10n/res/values-nl/strings.xml b/tools/recovery_l10n/res/values-nl/strings.xml
new file mode 100644
index 00000000..be80a6b5
--- /dev/null
+++ b/tools/recovery_l10n/res/values-nl/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Systeemupdate installeren…"
+ "Wissen…"
+ "Geen opdracht."
+ "Fout!"
+
diff --git a/tools/recovery_l10n/res/values-pa-rIN/strings.xml b/tools/recovery_l10n/res/values-pa-rIN/strings.xml
new file mode 100644
index 00000000..39ef32f5
--- /dev/null
+++ b/tools/recovery_l10n/res/values-pa-rIN/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "ਸਿਸਟਮ ਅਪਡੇਟ ਇੰਸਟੌਲ ਕਰ ਰਿਹਾ ਹੈ…"
+ "ਹਟਾ ਰਿਹਾ ਹੈ…"
+ "ਕੋਈ ਕਮਾਂਡ ਨਹੀਂ।"
+ "ਅਸ਼ੁੱਧੀ!"
+
diff --git a/tools/recovery_l10n/res/values-pl/strings.xml b/tools/recovery_l10n/res/values-pl/strings.xml
new file mode 100644
index 00000000..b1e5b7b6
--- /dev/null
+++ b/tools/recovery_l10n/res/values-pl/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Instaluję aktualizację systemu…"
+ "Usuwam…"
+ "Brak polecenia."
+ "Błąd"
+
diff --git a/tools/recovery_l10n/res/values-pt-rBR/strings.xml b/tools/recovery_l10n/res/values-pt-rBR/strings.xml
new file mode 100644
index 00000000..3cc57234
--- /dev/null
+++ b/tools/recovery_l10n/res/values-pt-rBR/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Instalando atualização do sistema..."
+ "Apagando..."
+ "Nenhum comando."
+ "Erro!"
+
diff --git a/tools/recovery_l10n/res/values-pt-rPT/strings.xml b/tools/recovery_l10n/res/values-pt-rPT/strings.xml
new file mode 100644
index 00000000..7d6bc18a
--- /dev/null
+++ b/tools/recovery_l10n/res/values-pt-rPT/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "A instalar a atualização do sistema..."
+ "A apagar…"
+ "Nenhum comando."
+ "Erro!"
+
diff --git a/tools/recovery_l10n/res/values-pt/strings.xml b/tools/recovery_l10n/res/values-pt/strings.xml
new file mode 100644
index 00000000..3cc57234
--- /dev/null
+++ b/tools/recovery_l10n/res/values-pt/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Instalando atualização do sistema..."
+ "Apagando..."
+ "Nenhum comando."
+ "Erro!"
+
diff --git a/tools/recovery_l10n/res/values-ro/strings.xml b/tools/recovery_l10n/res/values-ro/strings.xml
new file mode 100644
index 00000000..ad924da0
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ro/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Se instalează actualizarea de sistem…"
+ "Se efectuează ștergerea…"
+ "Nicio comandă."
+ "Eroare!"
+
diff --git a/tools/recovery_l10n/res/values-ru/strings.xml b/tools/recovery_l10n/res/values-ru/strings.xml
new file mode 100644
index 00000000..de0da400
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ru/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Установка обновления системы…"
+ "Удаление…"
+ "Команды нет"
+ "Ошибка"
+
diff --git a/tools/recovery_l10n/res/values-si-rLK/strings.xml b/tools/recovery_l10n/res/values-si-rLK/strings.xml
new file mode 100644
index 00000000..e717a976
--- /dev/null
+++ b/tools/recovery_l10n/res/values-si-rLK/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "පද්ධති යාවත්කාල ස්ථාපනය කරමින්…"
+ "මකමින්...."
+ "විධානයක් නොමැත."
+ "දෝෂය!"
+
diff --git a/tools/recovery_l10n/res/values-sk/strings.xml b/tools/recovery_l10n/res/values-sk/strings.xml
new file mode 100644
index 00000000..cae6bce7
--- /dev/null
+++ b/tools/recovery_l10n/res/values-sk/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Inštalácia aktualizácie systému..."
+ "Prebieha mazanie..."
+ "Žiadny príkaz."
+ "Chyba!"
+
diff --git a/tools/recovery_l10n/res/values-sl/strings.xml b/tools/recovery_l10n/res/values-sl/strings.xml
new file mode 100644
index 00000000..3f8d46fe
--- /dev/null
+++ b/tools/recovery_l10n/res/values-sl/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Namestitev posodobitve sistema ..."
+ "Brisanje ..."
+ "Ni ukaza"
+ "Napaka"
+
diff --git a/tools/recovery_l10n/res/values-sq-rAL/strings.xml b/tools/recovery_l10n/res/values-sq-rAL/strings.xml
new file mode 100644
index 00000000..29f8ef59
--- /dev/null
+++ b/tools/recovery_l10n/res/values-sq-rAL/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Po instalon përditësimin e sistemit..."
+ "Po spastron..."
+ "Nuk ka komanda."
+ "Gabim!"
+
diff --git a/tools/recovery_l10n/res/values-sr/strings.xml b/tools/recovery_l10n/res/values-sr/strings.xml
new file mode 100644
index 00000000..95532605
--- /dev/null
+++ b/tools/recovery_l10n/res/values-sr/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Инсталирање ажурирања система..."
+ "Брисање..."
+ "Нема команде."
+ "Грешка!"
+
diff --git a/tools/recovery_l10n/res/values-sv/strings.xml b/tools/recovery_l10n/res/values-sv/strings.xml
new file mode 100644
index 00000000..f875d300
--- /dev/null
+++ b/tools/recovery_l10n/res/values-sv/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Installerar systemuppdatering ..."
+ "Tar bort ..."
+ "Inget kommando."
+ "Fel!"
+
diff --git a/tools/recovery_l10n/res/values-sw/strings.xml b/tools/recovery_l10n/res/values-sw/strings.xml
new file mode 100644
index 00000000..1a530464
--- /dev/null
+++ b/tools/recovery_l10n/res/values-sw/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Inasakinisha sasisho la mfumo…"
+ "Inafuta…"
+ "Hakuna amri."
+ "Hitilafu!"
+
diff --git a/tools/recovery_l10n/res/values-ta-rIN/strings.xml b/tools/recovery_l10n/res/values-ta-rIN/strings.xml
new file mode 100644
index 00000000..f6f3e0e6
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ta-rIN/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "முறைமை புதுப்பிப்பை நிறுவுகிறது…"
+ "அழிக்கிறது…"
+ "கட்டளை இல்லை."
+ "பிழை!"
+
diff --git a/tools/recovery_l10n/res/values-te-rIN/strings.xml b/tools/recovery_l10n/res/values-te-rIN/strings.xml
new file mode 100644
index 00000000..6d0d17af
--- /dev/null
+++ b/tools/recovery_l10n/res/values-te-rIN/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "సిస్టమ్ నవీకరణను ఇన్స్టాల్ చేస్తోంది…"
+ "ఎరేజ్ చేస్తోంది…"
+ "ఆదేశం లేదు."
+ "లోపం!"
+
diff --git a/tools/recovery_l10n/res/values-th/strings.xml b/tools/recovery_l10n/res/values-th/strings.xml
new file mode 100644
index 00000000..bcdfa2b2
--- /dev/null
+++ b/tools/recovery_l10n/res/values-th/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "กำลังติดตั้งการอัปเดตระบบ…"
+ "กำลังลบ…"
+ "ไม่มีคำสั่ง"
+ "ข้อผิดพลาด!"
+
diff --git a/tools/recovery_l10n/res/values-tl/strings.xml b/tools/recovery_l10n/res/values-tl/strings.xml
new file mode 100644
index 00000000..be2ba264
--- /dev/null
+++ b/tools/recovery_l10n/res/values-tl/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Ini-install ang update sa system…"
+ "Binubura…"
+ "Walang command."
+ "Error!"
+
diff --git a/tools/recovery_l10n/res/values-tr/strings.xml b/tools/recovery_l10n/res/values-tr/strings.xml
new file mode 100644
index 00000000..8629029c
--- /dev/null
+++ b/tools/recovery_l10n/res/values-tr/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Sistem güncellemesi yükleniyor…"
+ "Siliniyor…"
+ "Komut yok."
+ "Hata!"
+
diff --git a/tools/recovery_l10n/res/values-uk/strings.xml b/tools/recovery_l10n/res/values-uk/strings.xml
new file mode 100644
index 00000000..762c06ff
--- /dev/null
+++ b/tools/recovery_l10n/res/values-uk/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Встановлення оновлення системи…"
+ "Стирання…"
+ "Немає команди."
+ "Помилка!"
+
diff --git a/tools/recovery_l10n/res/values-ur-rPK/strings.xml b/tools/recovery_l10n/res/values-ur-rPK/strings.xml
new file mode 100644
index 00000000..dc6eb6aa
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ur-rPK/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "سسٹم اپ ڈیٹ انسٹال ہو رہا ہے…"
+ "صاف کر رہا ہے…"
+ "کوئی کمانڈ نہیں ہے۔"
+ "خرابی!"
+
diff --git a/tools/recovery_l10n/res/values-uz-rUZ/strings.xml b/tools/recovery_l10n/res/values-uz-rUZ/strings.xml
new file mode 100644
index 00000000..28744841
--- /dev/null
+++ b/tools/recovery_l10n/res/values-uz-rUZ/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Tizim yangilanishi o‘rnatilmoqda…"
+ "Tozalanmoqda…"
+ "Buyruq yo‘q."
+ "Xato!"
+
diff --git a/tools/recovery_l10n/res/values-vi/strings.xml b/tools/recovery_l10n/res/values-vi/strings.xml
new file mode 100644
index 00000000..ab4005b7
--- /dev/null
+++ b/tools/recovery_l10n/res/values-vi/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Đang cài đặt bản cập nhật hệ thống…"
+ "Đang xóa…"
+ "Không có lệnh nào."
+ "Lỗi!"
+
diff --git a/tools/recovery_l10n/res/values-zh-rCN/strings.xml b/tools/recovery_l10n/res/values-zh-rCN/strings.xml
new file mode 100644
index 00000000..2e1a6f57
--- /dev/null
+++ b/tools/recovery_l10n/res/values-zh-rCN/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "正在安装系统更新…"
+ "正在清除…"
+ "无命令。"
+ "出错了!"
+
diff --git a/tools/recovery_l10n/res/values-zh-rHK/strings.xml b/tools/recovery_l10n/res/values-zh-rHK/strings.xml
new file mode 100644
index 00000000..f615c7a2
--- /dev/null
+++ b/tools/recovery_l10n/res/values-zh-rHK/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "正在安裝系統更新…"
+ "正在清除…"
+ "沒有指令。"
+ "錯誤!"
+
diff --git a/tools/recovery_l10n/res/values-zh-rTW/strings.xml b/tools/recovery_l10n/res/values-zh-rTW/strings.xml
new file mode 100644
index 00000000..f3f6a2c2
--- /dev/null
+++ b/tools/recovery_l10n/res/values-zh-rTW/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "正在安裝系統更新…"
+ "清除中..."
+ "沒有指令。"
+ "錯誤!"
+
diff --git a/tools/recovery_l10n/res/values-zu/strings.xml b/tools/recovery_l10n/res/values-zu/strings.xml
new file mode 100644
index 00000000..1f904a20
--- /dev/null
+++ b/tools/recovery_l10n/res/values-zu/strings.xml
@@ -0,0 +1,8 @@
+
+
+ "Ifaka isibuyekezo sesistimu…"
+ "Iyasula…"
+ "Awukho umyalo."
+ "Iphutha!"
+
diff --git a/tools/recovery_l10n/res/values/strings.xml b/tools/recovery_l10n/res/values/strings.xml
new file mode 100644
index 00000000..3a8aeec9
--- /dev/null
+++ b/tools/recovery_l10n/res/values/strings.xml
@@ -0,0 +1,34 @@
+
+
+
+ Go
+
+
+
+ - installing
+ - erasing
+ - no_command
+ - error
+
+
+
+ Installing system update\u2026
+
+
+ Erasing\u2026
+
+
+ No command.
+
+
+ Error!
+
+
diff --git a/tools/recovery_l10n/src/com/android/recovery_l10n/Main.java b/tools/recovery_l10n/src/com/android/recovery_l10n/Main.java
new file mode 100644
index 00000000..3f2bebe6
--- /dev/null
+++ b/tools/recovery_l10n/src/com/android/recovery_l10n/Main.java
@@ -0,0 +1,319 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.recovery_l10n;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.content.res.AssetManager;
+import android.content.res.Configuration;
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.os.Bundle;
+import android.os.RemoteException;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.TextView;
+import android.widget.Spinner;
+import android.widget.ArrayAdapter;
+import android.widget.AdapterView;
+
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Locale;
+
+/**
+ * This activity assists in generating the specially-formatted bitmaps
+ * of text needed for recovery's localized text display. Each image
+ * contains all the translations of a single string; above each
+ * translation is a "header row" that encodes that subimage's width,
+ * height, and locale using pixel values.
+ *
+ * To use this app to generate new translations:
+ *
+ * - Update the string resources in res/values-*
+ *
+ * - Build and run the app. Select the string you want to
+ * translate, and press the "Go" button.
+ *
+ * - Wait for it to finish cycling through all the strings, then
+ * pull /data/data/com.android.recovery_l10n/files/text-out.png
+ * from the device.
+ *
+ * - "pngcrush -c 0 text-out.png output.png"
+ *
+ * - Put output.png in bootable/recovery/res/images/ (renamed
+ * appropriately).
+ *
+ * Recovery expects 8-bit 1-channel images (white text on black
+ * background). pngcrush -c 0 will convert the output of this program
+ * to such an image. If you use any other image handling tools,
+ * remember that they must be lossless to preserve the exact values of
+ * pixels in the header rows; don't convert them to jpeg or anything.
+ */
+
+public class Main extends Activity {
+ private static final String TAG = "RecoveryL10N";
+
+ HashMap savedBitmaps;
+ TextView mText;
+ int mStringId = R.string.recovery_installing;
+
+ public class TextCapture implements Runnable {
+ private Locale nextLocale;
+ private Locale thisLocale;
+ private Runnable next;
+
+ TextCapture(Locale thisLocale, Locale nextLocale, Runnable next) {
+ this.nextLocale = nextLocale;
+ this.thisLocale = thisLocale;
+ this.next = next;
+ }
+
+ public void run() {
+ Bitmap b = mText.getDrawingCache();
+ savedBitmaps.put(thisLocale, b.copy(Bitmap.Config.ARGB_8888, false));
+
+ if (nextLocale != null) {
+ switchTo(nextLocale);
+ }
+
+ if (next != null) {
+ mText.postDelayed(next, 200);
+ }
+ }
+ }
+
+ private void switchTo(Locale locale) {
+ Resources standardResources = getResources();
+ AssetManager assets = standardResources.getAssets();
+ DisplayMetrics metrics = standardResources.getDisplayMetrics();
+ Configuration config = new Configuration(standardResources.getConfiguration());
+ config.locale = locale;
+ Resources defaultResources = new Resources(assets, metrics, config);
+
+ mText.setText(mStringId);
+
+ mText.setDrawingCacheEnabled(false);
+ mText.setDrawingCacheEnabled(true);
+ mText.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstance) {
+ super.onCreate(savedInstance);
+ setContentView(R.layout.main);
+
+ savedBitmaps = new HashMap();
+
+ Spinner spinner = (Spinner) findViewById(R.id.which);
+ ArrayAdapter adapter = ArrayAdapter.createFromResource(
+ this, R.array.string_options, android.R.layout.simple_spinner_item);
+ adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ spinner.setAdapter(adapter);
+ spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView parent, View view,
+ int pos, long id) {
+ switch (pos) {
+ case 0: mStringId = R.string.recovery_installing; break;
+ case 1: mStringId = R.string.recovery_erasing; break;
+ case 2: mStringId = R.string.recovery_no_command; break;
+ case 3: mStringId = R.string.recovery_error; break;
+ }
+ }
+ @Override public void onNothingSelected(AdapterView parent) { }
+ });
+
+ mText = (TextView) findViewById(R.id.text);
+
+ String[] localeNames = getAssets().getLocales();
+ Arrays.sort(localeNames);
+ ArrayList locales = new ArrayList();
+ for (String ln : localeNames) {
+ int u = ln.indexOf('_');
+ if (u >= 0) {
+ Log.i(TAG, "locale = " + ln);
+ locales.add(new Locale(ln.substring(0, u), ln.substring(u+1)));
+ }
+ }
+
+ final Runnable seq = buildSequence(locales.toArray(new Locale[0]));
+
+ Button b = (Button) findViewById(R.id.go);
+ b.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View ignore) {
+ mText.post(seq);
+ }
+ });
+ }
+
+ private Runnable buildSequence(final Locale[] locales) {
+ Runnable head = new Runnable() { public void run() { mergeBitmaps(locales); } };
+ Locale prev = null;
+ for (Locale loc : locales) {
+ head = new TextCapture(loc, prev, head);
+ prev = loc;
+ }
+ final Runnable fhead = head;
+ final Locale floc = prev;
+ return new Runnable() { public void run() { startSequence(fhead, floc); } };
+ }
+
+ private void startSequence(Runnable firstRun, Locale firstLocale) {
+ savedBitmaps.clear();
+ switchTo(firstLocale);
+ mText.postDelayed(firstRun, 200);
+ }
+
+ private void saveBitmap(Bitmap b, String filename) {
+ try {
+ FileOutputStream fos = openFileOutput(filename, 0);
+ b.compress(Bitmap.CompressFormat.PNG, 100, fos);
+ fos.close();
+ } catch (IOException e) {
+ Log.i(TAG, "failed to write PNG", e);
+ }
+ }
+
+ private int colorFor(byte b) {
+ return 0xff000000 | (b<<16) | (b<<8) | b;
+ }
+
+ private int colorFor(int b) {
+ return 0xff000000 | (b<<16) | (b<<8) | b;
+ }
+
+ private void mergeBitmaps(final Locale[] locales) {
+ HashMap countByLanguage = new HashMap();
+
+ int height = 2;
+ int width = 10;
+ int maxHeight = 0;
+ for (Locale loc : locales) {
+ Bitmap b = savedBitmaps.get(loc);
+ int h = b.getHeight();
+ int w = b.getWidth();
+ height += h+1;
+ if (h > maxHeight) maxHeight = h;
+ if (w > width) width = w;
+
+ String lang = loc.getLanguage();
+ if (countByLanguage.containsKey(lang)) {
+ countByLanguage.put(lang, countByLanguage.get(lang)+1);
+ } else {
+ countByLanguage.put(lang, 1);
+ }
+ }
+
+ Log.i(TAG, "output bitmap is " + width + " x " + height);
+ Bitmap out = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
+ out.eraseColor(0xff000000);
+ int[] pixels = new int[maxHeight * width];
+
+ int p = 0;
+ for (Locale loc : locales) {
+ Bitmap bm = savedBitmaps.get(loc);
+ int h = bm.getHeight();
+ int w = bm.getWidth();
+
+ bm.getPixels(pixels, 0, w, 0, 0, w, h);
+
+ // Find the rightmost and leftmost columns with any
+ // nonblack pixels; we'll copy just that region to the
+ // output image.
+
+ int right = w;
+ while (right > 1) {
+ boolean all_black = true;
+ for (int j = 0; j < h; ++j) {
+ if (pixels[j*w+right-1] != 0xff000000) {
+ all_black = false;
+ break;
+ }
+ }
+ if (all_black) {
+ --right;
+ } else {
+ break;
+ }
+ }
+
+ int left = 0;
+ while (left < right-1) {
+ boolean all_black = true;
+ for (int j = 0; j < h; ++j) {
+ if (pixels[j*w+left] != 0xff000000) {
+ all_black = false;
+ break;
+ }
+ }
+ if (all_black) {
+ ++left;
+ } else {
+ break;
+ }
+ }
+
+ // Make the last country variant for a given language be
+ // the catch-all for that language (because recovery will
+ // take the first one that matches).
+ String lang = loc.getLanguage();
+ if (countByLanguage.get(lang) > 1) {
+ countByLanguage.put(lang, countByLanguage.get(lang)-1);
+ lang = loc.toString();
+ }
+ int tw = right - left;
+ Log.i(TAG, "encoding \"" + loc + "\" as \"" + lang + "\": " + tw + " x " + h);
+ byte[] langBytes = lang.getBytes();
+ out.setPixel(0, p, colorFor(tw & 0xff));
+ out.setPixel(1, p, colorFor(tw >>> 8));
+ out.setPixel(2, p, colorFor(h & 0xff));
+ out.setPixel(3, p, colorFor(h >>> 8));
+ out.setPixel(4, p, colorFor(langBytes.length));
+ int x = 5;
+ for (byte b : langBytes) {
+ out.setPixel(x, p, colorFor(b));
+ x++;
+ }
+ out.setPixel(x, p, colorFor(0));
+
+ p++;
+
+ out.setPixels(pixels, left, w, 0, p, tw, h);
+ p += h;
+ }
+
+ // if no languages match, suppress text display by using a
+ // single black pixel as the image.
+ out.setPixel(0, p, colorFor(1));
+ out.setPixel(1, p, colorFor(0));
+ out.setPixel(2, p, colorFor(1));
+ out.setPixel(3, p, colorFor(0));
+ out.setPixel(4, p, colorFor(0));
+ p++;
+
+ saveBitmap(out, "text-out.png");
+ Log.i(TAG, "wrote text-out.png");
+ }
+}