Skip to content

Commit a9d5810

Browse files
committed
Don't build/install non-UTF-8 and encoding-converted locales
Currently a lot of the .po locale files are generated using iconv to different encodings. This is only necessary if the version of Vim does not have iconv and cannot dynamically convert encoding, which isn't the case for MacVim. Furthermore, MacVim should only work in UTF-8 anyway, so it's not useful to have all the other non-UTF-8 locales (e.g. zh_CN.cp936.po) being built and bundled together, as they make the build process more complicated and bulk up the binary size of the app bundle. Simply modify the Makefile to not install / build any of the duplicate locale files. For locales like ko/zh_CN/zh_TW, where the "base" version ko.po is in a non-UTF-8 locale and converted from a ko.UTF-8.po, we keep only the ko.UTF-8.po version, but during install we install the folder as "ko" instead of "ko.UTF-8". This way, if someone somehow set LANG=ko_KR, it will still work instead of having to set LANG=ko_KR.UTF-8. Currently, pl.po is an odd one out because pl.UTF-8.po is actually generated from pl.po, instead of the other way round. We just use pl.po since that's the source version, instead of using the generated UTF-8 one for simplicity (MacVim can handle it fine). Also, revert the MacVim-local translations made to these non-UTF8 locales like zh_CN.cp936.po, since we don't use them anymore in MacVim builds. Saved ~2 MB in the app bundle, and ~1MB in the generated dmg.
1 parent 4b30143 commit a9d5810

File tree

7 files changed

+73
-88
lines changed

7 files changed

+73
-88
lines changed

src/po/Make_all.mak

Lines changed: 63 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ LANGUAGES = \
66
af \
77
ca \
88
cs \
9-
cs.cp1250 \
109
da \
1110
de \
1211
en_GB \
@@ -17,40 +16,49 @@ LANGUAGES = \
1716
ga \
1817
it \
1918
ja \
20-
ja.euc-jp \
21-
ja.sjis \
22-
ko \
2319
ko.UTF-8 \
2420
lv \
2521
nb \
2622
nl \
2723
no \
2824
pl \
29-
pl.UTF-8 \
30-
pl.cp1250 \
3125
pt_BR \
3226
ru \
33-
ru.cp1251 \
3427
sk \
35-
sk.cp1250 \
3628
sr \
3729
sv \
3830
tr \
3931
uk \
40-
uk.cp1251 \
4132
vi \
42-
zh_CN \
4333
zh_CN.UTF-8 \
44-
zh_CN.cp936 \
45-
zh_TW \
4634
zh_TW.UTF-8 \
4735

36+
# MacVim: Don't bundle non-UTF-8 or encoding converted locale files as we always have iconv
37+
#cs.cp1250 \
38+
#ja.euc-jp \
39+
#ja.sjis \
40+
#ko \
41+
#pl.cp1250 \
42+
#pl.UTF-8 \
43+
#ru.cp1251 \
44+
#sk.cp1250 \
45+
#uk.cp1251 \
46+
#zh_CN \
47+
#zh_CN.cp936 \
48+
#zh_TW \
49+
50+
51+
# MacVim: We removed the non-UTF-8 base locales for these, so we upgrade the
52+
# <locale>.UTF-8 ones as base locales.
53+
LANGUAGES_UTF8_ONLY = \
54+
ko \
55+
zh_CN \
56+
zh_TW \
4857

4958
POFILES = \
5059
af.po \
5160
ca.po \
5261
cs.po \
53-
cs.cp1250.po \
5462
da.po \
5563
de.po \
5664
en_GB.po \
@@ -61,34 +69,37 @@ POFILES = \
6169
ga.po \
6270
it.po \
6371
ja.po \
64-
ja.euc-jp.po \
65-
ja.sjis.po \
66-
ko.po \
6772
ko.UTF-8.po \
6873
lv.po \
6974
nb.po \
7075
nl.po \
7176
no.po \
7277
pl.po \
73-
pl.UTF-8.po \
74-
pl.cp1250.po \
7578
pt_BR.po \
7679
ru.po \
77-
ru.cp1251.po \
7880
sk.po \
79-
sk.cp1250.po \
8081
sr.po \
8182
sv.po \
8283
tr.po \
8384
uk.po \
84-
uk.cp1251.po \
8585
vi.po \
86-
zh_CN.po \
8786
zh_CN.UTF-8.po \
88-
zh_CN.cp936.po \
89-
zh_TW.po \
9087
zh_TW.UTF-8.po \
9188

89+
# MacVim: Don't bundle non-UTF-8 or encoding converted locale files as we always have iconv
90+
#cs.cp1250.po \
91+
#ja.euc-jp.po \
92+
#ja.sjis.po \
93+
#ko.po \
94+
#pl.cp1250.po \
95+
#pl.UTF-8.po \
96+
#ru.cp1251.po \
97+
#sk.cp1250.po \
98+
#uk.cp1251.po \
99+
#zh_CN.po \
100+
#zh_CN.cp936.po \
101+
#zh_TW.po \
102+
92103

93104
MOFILES = \
94105
af.mo \
@@ -123,25 +134,26 @@ MOFILES = \
123134

124135

125136
MOCONVERTED = \
126-
cs.cp1250.mo \
127-
ja.euc-jp.mo \
128-
ja.sjis.mo \
129-
ko.mo \
130-
pl.UTF-8.mo \
131-
pl.cp1250.mo \
132-
ru.cp1251.mo \
133-
sk.cp1250.mo \
134-
uk.cp1251.mo \
135-
zh_CN.mo \
136-
zh_CN.cp936.mo \
137-
zh_TW.mo \
137+
138+
# MacVim: Don't bundle non-UTF-8 or encoding converted locale files as we always have iconv
139+
#cs.cp1250.mo \
140+
#ja.euc-jp.mo \
141+
#ja.sjis.mo \
142+
#ko.mo \
143+
#pl.cp1250.mo \
144+
#pl.UTF-8.mo \
145+
#ru.cp1251.mo \
146+
#sk.cp1250.mo \
147+
#uk.cp1251.mo \
148+
#zh_CN.mo \
149+
#zh_CN.cp936.mo \
150+
#zh_TW.mo \
138151
139152

140153
CHECKFILES = \
141154
af.ck \
142155
ca.ck \
143156
cs.ck \
144-
cs.cp1250.ck \
145157
da.ck \
146158
de.ck \
147159
en_GB.ck \
@@ -152,31 +164,34 @@ CHECKFILES = \
152164
ga.ck \
153165
it.ck \
154166
ja.ck \
155-
ja.euc-jp.ck \
156-
ja.sjis.ck \
157167
ko.UTF-8.ck \
158-
ko.ck \
159168
lv.ck \
160169
nb.ck \
161170
nl.ck \
162171
no.ck \
163-
pl.UTF-8.ck \
164172
pl.ck \
165-
pl.cp1250.ck \
166173
pt_BR.ck \
167174
ru.ck \
168-
ru.cp1251.ck \
169175
sk.ck \
170-
sk.cp1250.ck \
171176
sr.ck \
172177
sv.ck \
173178
tr.ck \
174179
uk.ck \
175-
uk.cp1251.ck \
176180
vi.ck \
177181
zh_CN.UTF-8.ck \
178-
zh_CN.ck \
179-
zh_CN.cp936.ck \
180182
zh_TW.UTF-8.ck \
181-
zh_TW.ck \
183+
184+
# MacVim: Don't bundle non-UTF-8 or encoding converted locale files as we always have iconv
185+
#cs.cp1250.ck \
186+
#ja.euc-jp.ck \
187+
#ja.sjis.ck \
188+
#ko.ck \
189+
#pl.cp1250.ck \
190+
#pl.UTF-8.ck \
191+
#ru.cp1251.ck \
192+
#sk.cp1250.ck \
193+
#uk.cp1251.ck \
194+
#zh_CN.ck \
195+
#zh_CN.cp936.ck \
196+
#zh_TW.ck \
182197

src/po/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ install: $(MOFILES) $(MOCONVERTED)
5555
$(INSTALL_DATA) $$lang.mo $$dir/$(PACKAGE).mo; \
5656
chmod $(FILEMOD) $$dir/$(PACKAGE).mo; \
5757
fi; \
58+
done; \
59+
# MacVim: We remove non-UTF-8 locales as it does not make sense to ship \
60+
# them on macOS. To make sure the base locales like "zh_TW" still works, we \
61+
# move them from the encoding-specific ones like "zh_TW.UTF-8" to "zh_TW"
62+
for lang_utf8_only in $(LANGUAGES_UTF8_ONLY); do \
63+
dir=$(LOCALEDIR)/$$lang_utf8_only; \
64+
if test -x "$$dir"; then \
65+
rm -rf "$$dir"; \
66+
fi; \
67+
mv "$$dir.UTF-8" "$$dir"; \
5868
done
5969

6070
uninstall:

src/po/ja.euc-jp.po

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3503,10 +3503,6 @@ msgstr "with Photon GUI."
35033503
msgid "with GUI."
35043504
msgstr "with GUI."
35053505

3506-
# MacVim only
3507-
msgid "with MacVim GUI."
3508-
msgstr "with MacVim GUI."
3509-
35103506
msgid " Features included (+) or not (-):\n"
35113507
msgstr " 機能の一覧 有効(+)/無効(-)\n"
35123508

@@ -3588,10 +3584,6 @@ msgstr "
35883584
msgid "type :help<Enter> or <F1> for on-line help"
35893585
msgstr "オンラインヘルプは :help<Enter> か <F1> "
35903586

3591-
# MacVim only
3592-
msgid "type :help macvim<Enter> for MacVim help "
3593-
msgstr "MacVim のオンラインヘルプは :help macvim<Enter> "
3594-
35953587
msgid "type :help version9<Enter> for version info"
35963588
msgstr "バージョン情報は :help version9<Enter> "
35973589

src/po/ja.sjis.po

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3503,10 +3503,6 @@ msgstr "with Photon GUI."
35033503
msgid "with GUI."
35043504
msgstr "with GUI."
35053505

3506-
# MacVim only
3507-
msgid "with MacVim GUI."
3508-
msgstr "with MacVim GUI."
3509-
35103506
msgid " Features included (+) or not (-):\n"
35113507
msgstr " 機能\の一覧 有効(+)/無効(-)\n"
35123508

@@ -3588,10 +3584,6 @@ msgstr "
35883584
msgid "type :help<Enter> or <F1> for on-line help"
35893585
msgstr "オンラインヘルプは :help<Enter> か <F1> "
35903586

3591-
# MacVim only
3592-
msgid "type :help macvim<Enter> for MacVim help "
3593-
msgstr "MacVim のオンラインヘルプは :help macvim<Enter> "
3594-
35953587
msgid "type :help version9<Enter> for version info"
35963588
msgstr "バージョン情報は :help version9<Enter> "
35973589

src/po/zh_CN.cp936.po

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3474,10 +3474,6 @@ msgstr "
34743474
msgid "with GUI."
34753475
msgstr "带图形界面。"
34763476

3477-
# MacVim only
3478-
msgid "with MacVim GUI."
3479-
msgstr "带 MacVim 图形界面。"
3480-
34813477
msgid " Features included (+) or not (-):\n"
34823478
msgstr " 可使用(+)与不可使用(-)的功能:\n"
34833479

@@ -3559,10 +3555,6 @@ msgstr "
35593555
msgid "type :help<Enter> or <F1> for on-line help"
35603556
msgstr "输入 :help<Enter> 或 <F1> 查看在线帮助 "
35613557

3562-
# MacVim only
3563-
msgid "type :help macvim<Enter> for MacVim help "
3564-
msgstr " 输入 :help macvim<Enter> 查看 MacVim 的在线帮助"
3565-
35663558
msgid "type :help version9<Enter> for version info"
35673559
msgstr "输入 :help version9<Enter> 查看版本信息 "
35683560

src/po/zh_CN.po

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3474,10 +3474,6 @@ msgstr "
34743474
msgid "with GUI."
34753475
msgstr "带图形界面。"
34763476

3477-
# MacVim only
3478-
msgid "with MacVim GUI."
3479-
msgstr "带 MacVim 图形界面。"
3480-
34813477
msgid " Features included (+) or not (-):\n"
34823478
msgstr " 可使用(+)与不可使用(-)的功能:\n"
34833479

@@ -3559,10 +3555,6 @@ msgstr "
35593555
msgid "type :help<Enter> or <F1> for on-line help"
35603556
msgstr "输入 :help<Enter> 或 <F1> 查看在线帮助 "
35613557

3562-
# MacVim only
3563-
msgid "type :help macvim<Enter> for MacVim help "
3564-
msgstr " 输入 :help macvim<Enter> 查看 MacVim 的在线帮助"
3565-
35663558
msgid "type :help version9<Enter> for version info"
35673559
msgstr "输入 :help version9<Enter> 查看版本信息 "
35683560

src/po/zh_TW.po

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4714,10 +4714,6 @@ msgstr "
47144714
msgid "with Cocoa GUI."
47154715
msgstr "使用 Cocoa 圖型界面。"
47164716

4717-
# MacVim only
4718-
msgid "with MacVim GUI."
4719-
msgstr "使用 MacVim 圖型界面。"
4720-
47214717
msgid "with (classic) GUI."
47224718
msgstr "使用 (傳統) 圖型界面。"
47234719

@@ -4799,10 +4795,6 @@ msgstr "
47994795
msgid "type :help<Enter> or <F1> for on-line help"
48004796
msgstr "線上說明請輸入 :help<Enter> "
48014797

4802-
# MacVim only
4803-
msgid "type :help macvim<Enter> for MacVim help "
4804-
msgstr "MacVim 線上說明請輸入 :help<Enter> "
4805-
48064798
msgid "type :help version9<Enter> for version info"
48074799
msgstr "新版本資訊請輸入 :help version9<Enter>"
48084800

0 commit comments

Comments
 (0)