Beruflich Dokumente
Kultur Dokumente
Guide
Including your translations into the Xiaomi.eu MIUI ROM
Step 1
Getting a repo on Linux
We prefer to use GIT for the management of our REPOs. If you use no version control system I
suggest viewing this link: http://gitimmersion.com/ In order to learn GIT. This system allows us to
be able to use as many languages as possible without any effort. Commands that you will
become familiar with.
● “git pull” - I ssue this command prior to doing anything to your REPO. This keeps it up
to date with the remote repository.
● “git add .” - Issue this command from the ROOT of your REPO prior to pushing. This
looks for any untracked files and adds them.
● “git commit -a” - Run this after the above command. This will stage your changes into a
ready to push message. Type a helpful short message explaining what you changed.
● “git push” - Assuming you set up the repos correctly. This will push your changes LIVE.
Our script will then find these changes automatically by the next time we run it. So keep
up with your daily translations :)
● “git status” - This will let you know of your current status. Its like running git commit,
without any consequences
So lets say you edit the framework-res.apk/res/values-en/strings.xml file. You will do this.
After installing and signing to your Github account, go to your repo with Internet Browser and
press Clone in Windows button
That will download your repo content to your PC in the folder c:\Users\YOU\Documents\GitHub\
where you can modify what you need...
After changing files, you can start Github on Windows and select your repo. Github will show
you new (uncommitted) changes what you made on your local repo..
Contacting ingbrzy via i ngbrzy@miuios.cz will help get you a private/public REPO available for
you to use.
Currently we have:
MIUIv4 repos:
These repos can be private or public depending on your preference. As long as you keep them
regularly updated they will continue to be built into our weekly ROM (assuming there is no errors).
Next we will talk about the structure of the REPO. Which in order to be automated with our build
must adhere to our guidelines. We start off the repo with a folder that is the name of your
language. EX English. The next part are two folders named “device” and “main”. The main
folder contains APK translations that work across all official Xiaomi MIUI devices. The “device”
folder has subfolders of the board name of the devices. These names for references are:
● crespo (Nexus S)
● maguro (Galaxy Nexus - GSM)
● mione_plus (Xiaomi MI-ONE Plus)
● GT-I9100 (Samsung Galaxy S2)
● hwu8860 (Huawei U8800 / Honor)
● hwu9200 (Huawei Ascend P1)
● LT18i (Sony Xperia Arc S)
● pyramid (HTC Sensation)
● endeavoru (HTC One X)
● mx (Meizu MX)
● ville (HTC One S)
● umts_spyder (Motorola RAZR)
● m0 (Samsung Galaxy S3)
● LT26i (Sony Xperia S)
● saga (HTC Desire S)
● GT-N7000 (Samsung Galaxy Note)
● vivo (HTC Incredible S)
● shooteru (HTC Evo 3D - GSM)
● grouper (Nexus 7)
● ventana (ZTE Grand-X)
● hwu9500 (Ascend D1)
● aries (Xiaomi MI-TWO)
● i_u (LG Optimus LTE - LU6200)
● edison (Motorola ME865)
● vision (HTC Desire Z)
● t03g (Galaxy Note 2)
● hwu9508 (Huawei Honor 2)
● taurus (Xiaomi MI-TWO A)
● pisces (Xiaomi Mi-3)
So currently our structure looks like this. (A deeper bullet point represents new folder)
● English/
○ main/
■ framework-res.apk/
● res/
○ values-en/
■ strings.xml
○ drawable-en-hdpi/
■ sym_keyboard_delete.png
○ device/
■ crespo/
● camera.apk/
● framework-res.apk/
■ maguro/
■ mione_plus/
● cit.apk/
■ aries/
● camera.apk
● cit.apk
● FM.apk
As you can see. MI ONE only apps such as Cit.apk are separated from the main branch from
this method. This allows us to build all ROMs at once without intervention. APKs in the device
folder have priority over the /main branch. Thus, if framework-res is in both the /main and
/device folder. The /device one will win.
Translators should decompile a framework-res.apk from a source build device (Nexus S, Galaxy
Nexus or MI ONE) and place that translated framework-res.apk in the /main folder, and
decompile the framework-res.apk from ALL the other phones and place them in /device area.
Step 3
Adhering to the rules of values-xx
Inside every APK, we have the values folders. The default one (values) is what is loaded by default prior
to any language change. If a language change occurs the values-xx will be loaded, where xx is the iso 2
letter code of your language. I use this website: l ang-codes to find language codes.
Language Chines English Polish Dutch Italian Danish Arabic German Korean
e
ISO Code cn en pl nl it da ar de ko
So these languages would operate under the /res folder with subfolders such as
● values-pl
● drawable-pl-hdpi
● raw-pl
● drawable-pl-xhdp
( For the Polish language)
This creates a multi-language ROM, since anytime you change languages via the settings the entire ROM
switches over to those folders (hence changing the language).
There is one problem. The values-xx-rXX folder in the framework-miui-res and framework-res is different
than ANY other folder. You must use this link:
http://colincooper.net/blog/2011/02/17/android-supported-language-and-locales/ to find the correct representation.
EX: English
values-en-rGB ( English - Great Britain)
values-en-rUS (English - United States)
So you use values-xx in every APK, and then values-xx-rXX in the framework-miui-res.apk and
framework-res.apk
Step 4
Random apktool fixes what not
As much as everyone experienced, you cannot simply decompile and recompile MIUI v8. There are errors
caused by apktool which cause the rebuild to fail. We have included all needed fixes into our source
code. So when the scripts pull translations, it doesn’t have to worry about apktool fixes.
Step 5
Making multi-language support
Some translators may forget that there are other languages. So no languages can override files during
the script build. This means that if some language has a drawable-hdpi folder (without adding their own
drawable-xx-hdpi language), the script won’t include that as it overrides a folder. This prevents one
language from dominating other languages. Currently there is known support for these folders located
inside the /res folder.
● values-xx
○ strings.xml
○ arrays.xml
● drawable-xx
● drawable-xx-hdpi (480p)
● drawable-xx-xhdpi (720p)
● drawable-xx-xxhdpi (1080p)
● raw-xx
● drawable-xx-rXX
● assets/
○ yellowpage-xx.json
○ etc.
● xml-xx
Step 5a
Translating the lockscreen date
In MIUIv5 is no more used translation of “Battery charge”, etc.. there is just needed to translate date
format on lockscreen.. For that purpose, you have to place strings_xx.xml into your repo to location:
ere
Language / extras / lockscreen / strings / strings_xx.xml like h
We support also translating for week days of default clock 2x4 widget... For that purpose you have to
place translated pngs into Language / extras / simple_clock / images_xx like here
Default week days images and PSD can be found here
Step 5b - Important
EXCLUDE (delete) values and non translatable strings
Files in the /values or any directory that do NOT have a locale code should not be included. This also
means any string that has “_value” in it. Should be deleted. This is a non-translatable value. Excluding
these values will prevent an FC when MIUI China updates. (Since they will be pulled from the default of
/values, which is untouched).
Step 6
Regular updates.
Since translations are not the default language, missing a weekly update causes no problems except
missing strings. The APKs will continue to build, it just will pull the default strings for any that are missing
from the values folder (which is English based). So in order to keep the ROM up to date with ALL
languages REPOs must be kept up to date using Step 1.
Our build script automatically pulls updates during build, so as long as the REPO stays up to date the
build script will continue to pull it.
Step 7
Learning bitbucket / Github on Linux
The first thing to do is register a bitbucket/github account. If you sent an email via Step 2, then a Staff
member will send you an invite to bitbucket. So simply sign up using that. Once registered, sign into
https://bitbucket.org/ / https://github.com. The initial screen should show all REPOs that you have access to.
Leave that as default and simply click enter. The next part will ask for a keyphrase. Make this something
easier to remember, but hard enough that is someone gained access to your server they couldn’t easily
push to our REPOs. Now you have a key made.
Simply run something like vim ~/.ssh/id_rsa.pub to view the file. Copy the entire contents of that file into
the “SSH Key” field on bitbucket. Congrats. You are now synced with bitbucket. Run git clone url_to_repo
to begin work on translations.
The below commands must be run at the git bash screen. Which will setup your account and personalize
it.
This is so that when you push changes its associated to your account. Otherwise it says “Unknown” :(
Step 8
Key points to remember for linux
● Always run “git pull” before working on translations. Some staff member may of fixed your REPO
or performed a change, and if you begin working without pulling new versions it may create
conflicts which are difficult to resolve.
● Always before making new changes to your local repo, delete it from your HDD and Clone it
again from Github.. Some staff member may of fixed your REPO or performed a change, and if
you begin working without pulling new versions it may create conflicts which are difficult to
resolve.
Step 9
Random Programs
● Apktool
○ brut.all / iBotPeaches
○ Apktool is used for decompiling APKs and recompiling them. Used for translating, but can
also be used for illegal stuff :/
○ http://code.google.com/p/android-apktool/
● smali/baksmali
○ JesusFreke
○ smali/baksmali is an assembler/disassembler for the dex format used by dalvik, Android's
Java VM implementation.
○ http://code.google.com/p/smali/
Step 9a
Keeping up with XML changes
Follow this REPO: https://github.com/Acid-miuipolskapl/v8-XML-Compare all changes will be posted there daily
along with tips and anything that might interupt the translating process. Follow “cancro” device for daily
XML changes.
Step 10
Credits
French 012
December 28, 2 Abdess, Matzounet fr