Tutorial MB4 lang files packer/unpacker

Joined
Oct 7, 2019
Messages
18
Likes
44
Points
13
#1
Made a program for packing/unpacking language files (*.dat). You need .Net to run it

To unpack:
1. First you need to unpack resource file MB4 Resource pack/unpack | Xiaomi Mi Band 4 | GeekDoing
2. Then drag and drop the .dat file onto mb4_lang_tool.exe
3. A folder with utf-8 encoded .txt translation files and header.json header files file should appear next to the .dat file

For packing:
1. drag and drop the folder with translations (.txt files) onto mb4_lang_tool.exe
2. in the folder with translations should appear .dat file, which can be packaged into resources

Regarding .txt files:
\n in .txt files means line break
you should not change the number of rows
the name of the file with the translation (*.txt) must match the name of the translation ("name") in the header.json file

Regarding header.json:
"number" - translation number, bracelet identifies translations by number
"device_language" is the name of the language to which the "number" corresponds. just for reference, does not affect anything
"name" - name of the translation in the language file + name of the file containing the translation

For example, to replace Chinese there are two ways:
1. copy the contents of the file Russian ru.txt to zh-rCN.txt
2. in the header.json file for the language with the number 0 (which corresponds to the Chinese language), change the value of "name": "zh-rCN" to "name": "Russian ru", then during packing of the .dat file, Russian ru.txt will be used instead zh-rCN.txt

For the English translation a separate truncated chartable is used, only with latin letters. Therefore, you cannot replace English with another language, which uses letters other than the English alphabet.

 

Attachments

Last edited:
Joined
Jun 16, 2019
Messages
43
Likes
15
Points
13
#3
Made a program for packing/unpacking language files (*.dat). You need .Net to run it

To unpack:
1. First you need to unpack resource file MB4 Resource pack/unpack | Xiaomi Mi Band 4 | GeekDoing
2. Then drag and drop the .dat file onto mb4_lang_tool.exe
3. A folder with utf-8 encoded .txt translation files and header.json header files file should appear next to the .dat file

For packing:
1. drag and drop the folder with translations (.txt files) onto mb4_lang_tool.exe
2. in the folder with translations should appear .dat file, which can be packaged into resources

Regarding .txt files:
\n in .txt files means line break
you should not change the number of rows
the name of the file with the translation (*.txt) must match the name of the translation ("name") in the header.json file

Regarding header.json:
"number" - translation number, bracelet identifies translations by number
"device_language" is the name of the language to which the "number" corresponds. just for reference, does not affect anything
"name" - name of the translation in the language file + name of the file containing the translation

For example, to replace Chinese there are two ways:
1. copy the contents of the file Russian ru.txt to zh-rCN.txt
2. in the header.json file for the language with the number 0 (which corresponds to the Chinese language), change the value of "name": "zh-rCN" to "name": "Russian ru", then during packing of the .dat file, Russian ru.txt will be used instead zh-rCN.txt

For the English translation a separate truncated chartable is used, only with latin letters. Therefore, you cannot replace English with another language.

so if i change the name from portuguese pt to zh-rCN the default language will be portuguese?
 
Joined
Oct 7, 2019
Messages
18
Likes
44
Points
13
#4
so if i change the name from portuguese pt to zh-rCN the default language will be portuguese?
no, the default language for ch version is language with number 0, and for the global version - number 2.
so, you need to change the name to "Portuguese pt" for language number 0 or 2.

note: Chinese uses images for the main menu labels(Status, Heart rate...), so you need to redraw them
 
Joined
Jun 16, 2019
Messages
43
Likes
15
Points
13
#5
no, the default language for ch version is language with number 0, and for the global version - number 2.
so, you need to change the name to "Portuguese pt" for language number 0 or 2.

note: Chinese uses images for the main menu labels(Status, Heart rate...), so you need to redraw them
I got it, thanks
 
Joined
Jul 21, 2018
Messages
74
Likes
31
Points
23
#6
sir, can i modify original language (e.g. ID) using any text editor and then repack it?
im afraid of brick ?
 
Joined
Oct 7, 2019
Messages
18
Likes
44
Points
13
#7
sir, can i modify original language (e.g. ID) using any text editor and then repack it?
im afraid of brick ?
yes, you can edit .txt files with any text editor, but using utf-8 encoding.
just don`t delete any language and you`ll be fine)
 
Joined
Aug 26, 2018
Messages
84
Likes
51
Points
23
#9
Sorry I didn't understand the last line

Can we copy English strings on Arabic or not?
 
Joined
Oct 7, 2019
Messages
18
Likes
44
Points
13
#10
Sorry I didn't understand the last line

Can we copy English strings on Arabic or not?
For language number 2(English) you can not use any letters different from the english alphabet, otherwise there will be blank spaces instead of letters

For other languages the normal character table used, so there is no restrictions on the letters you use
 

SARRAF

Well-known member
Joined
Oct 2, 2019
Messages
281
Likes
327
Points
73
#13
Can I edit a file that has completely different letters than English? will it be displayed on the band?
(like Hindi or Bangla)
 
Joined
Nov 9, 2019
Messages
53
Likes
4
Points
13
#14
Can I edit a file that has completely different letters than English? will it be displayed on the band?
(like Hindi or Bangla)
First unpack resource file and copy 2250 no file which look like media player copy this on desktop than drop this file into mb4 language file then 2250 name new folder is open edit this folder than drop this folder into mb4 language file then new file is formed copy this file paste into MB4 resource file
 

chienkd

Active member
Joined
Jul 1, 2018
Messages
129
Likes
56
Points
33
#19
Made a program for packing/unpacking language files (*.dat). You need .Net to run it

To unpack:
1. First you need to unpack resource file MB4 Resource pack/unpack | Xiaomi Mi Band 4 | GeekDoing
2. Then drag and drop the .dat file onto mb4_lang_tool.exe
3. A folder with utf-8 encoded .txt translation files and header.json header files file should appear next to the .dat file

For packing:
1. drag and drop the folder with translations (.txt files) onto mb4_lang_tool.exe
2. in the folder with translations should appear .dat file, which can be packaged into resources

Regarding .txt files:
\n in .txt files means line break
you should not change the number of rows
the name of the file with the translation (*.txt) must match the name of the translation ("name") in the header.json file

Regarding header.json:
"number" - translation number, bracelet identifies translations by number
"device_language" is the name of the language to which the "number" corresponds. just for reference, does not affect anything
"name" - name of the translation in the language file + name of the file containing the translation

For example, to replace Chinese there are two ways:
1. copy the contents of the file Russian ru.txt to zh-rCN.txt
2. in the header.json file for the language with the number 0 (which corresponds to the Chinese language), change the value of "name": "zh-rCN" to "name": "Russian ru", then during packing of the .dat file, Russian ru.txt will be used instead zh-rCN.txt

For the English translation a separate truncated chartable is used, only with latin letters. Therefore, you cannot replace English with another language, which uses letters other than the English alphabet.

Can you help me to make the unpack tool work with Amazfit Bip resources? Version 85. Thanks.
 

razaghi

New member
Joined
Dec 24, 2020
Messages
9
Likes
16
Points
3
#20
Thank you for your time and effort.
I used your program to unpack mi band 5 font files (*.dat) and it worked perfectly.
But, it can't unpack the font file of Amazfit Band 5 :(
The dat file "3844.dat" extracted from "york_v104.res" and the screenshot of the error are attached.
let me know if you require any additional information.
 

Attachments

Trusted Store

Members online

No members online now.

Our Telegram Channel

Which color of official strap would you like to buy for your Mi Band 3?

  • Black

    Votes: 2,156 52.8%
  • Deep Blue

    Votes: 1,198 29.3%
  • Redish Orange

    Votes: 729 17.9%

Forum statistics

Threads
2,454
Messages
40,621
Members
211,997
Latest member
Yenry
Top