Sie sind auf Seite 1von 16

MIUI Build Bot Translation

Guide
Including your translations into the Xiaomi.eu MIUI ROM

Original Project Design Structure by​ ​iBotPeaches


Original Project idea by MarkHUK
Updated by ingbrzy

Last Updated: ​Feb 14. 2017

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
1
 

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.

(Anything surrounded by yellow dots. You will run)

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
2
Getting a repo on Windows

Download Github for Windows from ​http://windows.github.com/

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..

Write Commit message (what is changed) and press ​COMMIT​ button..


Now you need just sync your changes with repo on Github by pressing ​Sync​ button and you are
done...

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
3
© Copyright work of the author(s)
Xiaomi.eu - Redefining Android Since 2010
4
 
Step 2
Obtaining a 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:

● E​nglish - ​https://github.com/iBotPeaches/MIUIAndroid_XML​ - Public


● Italian - ​https://bitbucket.org/iBotPeaches/ma-xml-4.0-italy​ - ​Private
● Dutch - ​https://bitbucket.org/iBotPeaches/ma-xml-4.0-dutch​ - Public
● Polish - ​https://github.com/Acid-miuipolskapl/XML_MIUI-4.0​ - Public
● Korean - ​https://github.com/iAmGhost/ma-xml-4.0-korean​ - Public
● Romanian - ​https://bitbucket.org/iBotPeaches/ma-xml-4.0-romanian​ - ​Private
● Danish - ​https://bitbucket.org/iBotPeaches/ma-xml-4.0-danish​ - Public
● Arabic - ​https://github.com/MIUI-Palestine/MIUIPalestine_XML​ - Public
● Spanish - ​https://bitbucket.org/iBotPeaches/ma-xml-4.0-spanish​ - Public
● German - ​https://github.com/Bitti09/ma-xml-4.0-german​ - ​Private
● Russian - ​https://github.com/KDGDev/miui-v4-russian-translation-for-miuiandroid​ - Public
● Swedish - ​https://bitbucket.org/iBotPeaches/ma-xml-4.0-swedish​ - Public
● Ukrainian - ​https://github.com/KDGDev/miui-v4-ukrainian-translation-for-miuiandroid​ - Public
● ​ rivate
Norwegian - ​https://bitbucket.org/iBotPeaches/ma-xml-4.0-norwegian​ -​ P
● Hebrew - ​https://bitbucket.org/hebmiui/hebrew_strings/​ - Public
● Slovak - ​https://github.com/ingbrzy/ma-xml-4.0-slovak​ - Public
● Hungarian - ​https://github.com/vagyula1/miuihu-v4-hungarian-translation​ - Public
● Czech - ​https://github.com/czjomi/ma-xml-4.0-czech​ - Public
● Greek - ​https://bitbucket.org/iBotPeaches/ma-xml-4.0-greek​ - Public
● Vietnam - ​https://bitbucket.org/iBotPeaches/ma-xml-4.0-vietnam​ - Public
● French - ​https://github.com/ingbrzy/ma-xml-4.1-french​ - Public
● Finnish - ​https://github.com/ingbrzy/ma-xml-4.1-finnish​ - Public
● Turkish - ​https://bitbucket.org/iBotPeaches/miui-turkish-translation​ - Public

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
5
MIUIv5 repos:

● English - ​https://github.com/MarkH-UK/miui-uk​- Public


● Slovak - ​https://github.com/MIUICzech-Slovak/MA-XML-5.0-SLOVAK​ - Public
● Czech - ​https://github.com/MIUICzech-Slovak/MA-XML-5.0-CZECH​ - Public
● French - ​https://github.com/ingbrzy/ma-xml-5.0-FRENCH​ - Public
● Polish - ​https://github.com/Acid-miuipolskapl/XML_MIUI-v5​ - Public
● Hungarian - ​https://github.com/vagyula1/miui-v5-hungarian-translation-for-miuiandroid​ - Public
● Russian - ​https://github.com/KDGDev/miui-v5-russian-translation-for-miuiandroid​ - Public
● Ukrainian - ​https://github.com/KDGDev/miui-v5-ukrainian-translation-for-miuiandroid​ - Public
● Swedish - ​https://github.com/ingbrzy/ma-xml-5.0-SWEDISH​ - Public
● German - ​https://github.com/Bitti09/ma-xml-5.0-german​ - Public
● Danish -​ ​https://github.com/1982Strand/XML_MIUI-v5_Danish​ -​ Public
● Dutch - ​https://github.com/Redmaner/MA-XML-5.0-DUTCH​ - Public
● Greek - ​https://bitbucket.org/finner/ma-xml-5.0-greek​ - ​Private
● Spanish -​ ​https://github.com/ingbrzy/MA-XML-5.0-SPANISH​ ​- Public
● Italian - ​https://bitbucket.org/Mish/miui_v5_italy​ - Public
● Arabic - ​https://github.com/MIUI-Palestine/MIUIPalestine_V5_Arabic_XML​ - Public
● Vietnamese -​ ​https://github.com/HoangTuBot/MA-xml-v5-vietnam​ - Public
● Norwegian - ​https://github.com/ingbrzy/MA-XML-5.0-NORWEGIAN​ - Public
● Brazilian-Portuguese - ​https://bitbucket.org/miuibrasil/ma-xml-5.0-portuguese-brazilian​ ​- Private
● Indonesian - ​https://github.com/ingbrzy/MA-XML-5.0-INDONESIAN​ - Public
● Korean - ​https://github.com/nosoy1/ma-xml-5.0-korean​ - Public
● Turkish - ​https://github.com/ingbrzy/MA-XML-5.0-TURKISH​ - Public
● Romanian - ​https://github.com/ingbrzy/MA-XML-5.0-ROMANIAN​ - Public
● Bulgarian - ​https://github.com/ingbrzy/MA-XML-5.0-BULGARIAN​ - Public
● Thai - ​https://github.com/rcset/MIUIAndroid_XML_v5_TH​ - Public
● Finnish - ​https://github.com/ingbrzy/MA-XML-5.0-FINNISH​ - Public
● Malay - ​https://github.com/ingbrzy/MA-XML-5.0-MALAY​ - Public

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).

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
6
 
Step 2a
Device naming

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)

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
7
 
Step 2b
Device file structure

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.

One thing to mention regarding ​framework-res.apk​ (arrays.xml). Only place <string-array>


groups that you are translating. This allows new <string-arrays> to be added without any
problems in the ROM. Anything not including in your language will be pulled from the default.
Only putting <string-array>’s in that you translate keep the ROM size down and prevent errors.

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
8
 

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.

Below is some examples of the 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).

Read this regarding framework-miui-res.apk & framework-res.apk

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

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
9
 

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.

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
10
 

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

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
11
 

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

Translating week days of default clock widget 2x4

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.

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
12
 

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.

Click ​“Your name” -> Account -> SSH


Keys.​ If you know what to do here. Go
ahead and add your SSH key. So that
you can push/pull to this REPO
without problems.

If not, the best bet is to re-generate an


SSH key on your server/computer.
This guide is assuming linux.

Run “​ssh-keygen”​ at command line. It


will ask what you want to save your
key as. The default is (id_rsa).

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.

git config --global user.name “FIRSTNAME LASTNAME”


git config --global user.email “email here”

This is so that when you push changes its associated to your account. Otherwise it says “Unknown” :(

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
13
 

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.

Key points to remember for Windows

● 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.

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
14
 

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.

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
15
 

Step 10
Credits

Language Date Started Authors ISO Code


English October 2010 MarkHUK, iBotPeaches en

Chinese June 2010 Xiaomi zh

Polish May 18, 2012 Acid pl

Dutch May 18, 2012 quidje, Redmaner nl

Italian May 18, 2012 Mish it

Korean May 23, 2013 nosoy1 ko

Spanish May 25, 2012 DhK, LordStenka, Ehrans es

German May 25, 2012 Gerret84, bitti09, bobquentok de

Danish May 25, 2012 1982Strand da

Russian May 28, 2012 KDGDev Group ru

Ukrainian May 28, 2012 KDGDev Group uk

Arabic January 14, 2013 MIUI Palestine ar

Hebrew June 24, 2012 roenano iw

Hungarian July 5, 2012 vagyula hu

Slovak July 5, 2012 ingbrzy sk

Czech July 5, 2012 kynio, zeduaz, bckp cs

Greek July 31, 2012 Finner el

Turkish August 21, 2012 Celaleddin Madencan tr

Vietnamese April 07, 2013 HoandTuBot vi

French ​ 012
December 28,​ 2 Abdess, Matzounet fr

Finnish December 20, 2013 fi

Swedish soon Conny1985 sv

Norwegian April 03, 2013 datagutt,​ ​trondkevin nb

© Copyright work of the author(s)


Xiaomi.eu - Redefining Android Since 2010
16

Das könnte Ihnen auch gefallen