platform_bootable_recovery/tools/recovery_l10n
Tianjie Xu 9f843e7751 Add description for the new translation
As we localize the wipe data menu under the recovery mode, some
additional strings need the new translation. The strings include
1. The menu header that prompts a data wipe
2. Try again description
3. Factory reset description
4. The menu header to confirm a data wipe
5. Cancel description

We will resue the "Factory reset description" in the confirmation menu;
and the image_generator tool will be moved to this directory in later
cls.

Bug: 74397117
Test: mma
Change-Id: I706b8677dba506b62e890f6b200e3eb3b11ce483
2018-10-29 14:43:44 -07:00
..
res Add description for the new translation 2018-10-29 14:43:44 -07:00
src/com/android/recovery_l10n Update background text images in recovery 2017-01-07 00:32:40 +00:00
Android.bp tools: Move to Soong. 2018-05-17 13:10:08 -07:00
AndroidManifest.xml Move recovery_l10n here from development/tools. 2016-03-26 08:45:51 -07:00
README.md Restore the max width for recovery background texts 2017-01-22 18:46:04 -08:00

Steps to regenerate background text images under res-*dpi/images/

  1. Build the recovery_l10n app:

    cd bootable/recovery && mma -j32

  2. Install the app on the device (or emulator) with the intended dpi.

    • For example, we can use Nexus 5 to generate the text images under res-xxhdpi.
    • We can set up the maximum width of the final png image in res/layout/main.xml Currently, the image width is 1200px for xxxhdpi, 900px for xxhdpi and 480px for xhdpi/hdpi/mdpi.
    • When using the emulator, make sure the NDK version matches the current repository. Otherwise, the app may not work properly.

    adb install $PATH_TO_APP

  3. Run the app, select the string to translate and press the 'go' button.

  4. After the app goes through the strings for all locales, pull the output png file from the device.

    adb root && adb pull /data/data/com.android.recovery_l10n/files/text-out.png

  5. Compress the output file put it under the corresponding directory.

    • "pngcrush -c 0 ..." converts "text-out.png" into a 1-channel image, which is accepted by Recovery. This also compresses the image file by ~60%.
    • zopflipng could further compress the png files by ~10%, more details in https://github.com/google/zopfli/blob/master/README.zopflipng
    • If you're using other png compression tools, make sure the final text image works by running graphic tests under the recovery mode.

    pngcrush -c 0 text-out.png $OUTPUT_PNG