-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathlangpack.cmd
40 lines (31 loc) · 1.3 KB
/
langpack.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
mkdir langpacks
cd langpacks
:: Get language pack
wget http://ftp.mozilla.org/pub/thunderbird/candidates/102.15.0-candidates/build1/linux-x86_64/xpi/%~1.xpi
:: Remove stuff we don't want from the language pack
7z d %~1.xpi chrome\%~1\locale\%~1\branding
7z d %~1.xpi localization\%~1\branding
:: Unpack the language pack
7z x %~1.xpi
rm -f %~1.xpi
:: Fix the manifest.
sed -i -e 's/langpack-%~1@thunderbird.mozilla.org/langpack-%~1@betterbird.eu/' manifest.json
sed -i -e 's/Language pack for Thunderbird/Language pack for Betterbird/' manifest.json
sed -i -e 's/"gecko": {/"gecko": { "update_url": "https:\/\/www.betterbird.eu\/downloads\/LanguagePacks\/updates.json",/' manifest.json
:: Copy US branding
7z x ..\betterbird-%~2.en-US.win64.installer.exe core\omni.ja
7z x core\omni.ja chrome\en-US\locale\en-US\branding\
7z x core\omni.ja localization\en-US\branding
mv chrome\en-US\locale\en-US\branding\ chrome\%~1\locale\%~1\branding\
mv localization\en-US\branding localization\%~1\branding\
rmdir /s /q chrome\en-US
rmdir /s /q localization\en-US
:: Call script that provides extra strings
call ..\%~1.cmd
:: Pack the whole thing again
7z a -r -tzip %~1-%~2.xpi manifest.json chrome localization
rmdir /s /q chrome
rmdir /s /q localization
rmdir /s /q core
rm manifest.json
cd ..