Mercurial > vim
comparison src/po/Makefile @ 33823:45c0a5330758 v9.0.2127
patch 9.0.2127: translation Makefiles can be improved
Commit: https://github.com/vim/vim/commit/e214692718d6a997a0540fc688e1417564416f80
Author: RestorerZ <restorer@mail2k.ru>
Date: Thu Nov 23 20:58:32 2023 +0100
patch 9.0.2127: translation Makefiles can be improved
Problem: translation Makefiles can be improved
Solution: Modified and extended po-related Makefiles and
related files
closes: #13518
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 23 Nov 2023 21:15:03 +0100 |
parents | 695b50472e85 |
children | 2b222b99faec |
comparison
equal
deleted
inserted
replaced
33822:abd7434511dc | 33823:45c0a5330758 |
---|---|
100 # second byte. Don't depend on sjiscorr, it should only be compiled when | 100 # second byte. Don't depend on sjiscorr, it should only be compiled when |
101 # ja.sjis.po is outdated. | 101 # ja.sjis.po is outdated. |
102 ja.sjis.po: ja.po | 102 ja.sjis.po: ja.po |
103 @$(MAKE) sjiscorr | 103 @$(MAKE) sjiscorr |
104 rm -f ja.sjis.po | 104 rm -f ja.sjis.po |
105 iconv -f utf-8 -t cp932 ja.po | ./sjiscorr > ja.sjis.po | 105 iconv -f UTF-8 -t CP932 ja.po | ./sjiscorr > ja.sjis.po |
106 | 106 |
107 sjiscorr: sjiscorr.c | 107 sjiscorr: sjiscorr.c |
108 $(CC) -o sjiscorr sjiscorr.c | 108 $(CC) -o sjiscorr sjiscorr.c |
109 | 109 |
110 ja.euc-jp.po: ja.po | 110 ja.euc-jp.po: ja.po |
111 iconv -f utf-8 -t euc-jp ja.po | \ | 111 iconv -f UTF-8 -t EUC-JP ja.po | \ |
112 $(SED) -e 's/charset=[uU][tT][fF]-8/charset=euc-jp/' -e 's/# Original translations/# Generated from ja.po, DO NOT EDIT/' > ja.euc-jp.po | 112 $(SED) -e 's/charset=[uU][tT][fF]-8/charset=EUC-JP/' \ |
113 -e 's/# Original translations/# Generated from ja.po, DO NOT EDIT/' \ | |
114 > ja.euc-jp.po | |
113 | 115 |
114 # Convert cs.po to create cs.cp1250.po. | 116 # Convert cs.po to create cs.cp1250.po. |
115 cs.cp1250.po: cs.po | 117 cs.cp1250.po: cs.po |
116 rm -f cs.cp1250.po | 118 rm -f cs.cp1250.po |
117 iconv -f iso-8859-2 -t cp1250 cs.po | \ | 119 iconv -f ISO-8859-2 -t CP1250 cs.po | \ |
118 $(SED) -e 's/charset=ISO-8859-2/charset=cp1250/' -e 's/# Original translations/# Generated from cs.po, DO NOT EDIT/' > cs.cp1250.po | 120 $(SED) -e 's/charset=[iI][sS][oO]-8859-2/charset=CP1250/' \ |
121 -e 's/# Original translations/# Generated from cs.po, DO NOT EDIT/' \ | |
122 > cs.cp1250.po | |
119 | 123 |
120 # Convert pl.po to create pl.cp1250.po. | 124 # Convert pl.po to create pl.cp1250.po. |
121 pl.cp1250.po: pl.po | 125 pl.cp1250.po: pl.po |
122 rm -f pl.cp1250.po | 126 rm -f pl.cp1250.po |
123 iconv -f iso-8859-2 -t cp1250 pl.po | \ | 127 iconv -f ISO-8859-2 -t CP1250 pl.po | \ |
124 $(SED) -e 's/charset=ISO-8859-2/charset=cp1250/' -e 's/# Original translations/# Generated from pl.po, DO NOT EDIT/' > pl.cp1250.po | 128 $(SED) -e 's/charset=[iI][sS][oO]-8859-2/charset=CP1250/' \ |
129 -e 's/# Original translations/# Generated from pl.po, DO NOT EDIT/' \ | |
130 > pl.cp1250.po | |
125 | 131 |
126 # Convert pl.po to create pl.UTF-8.po. | 132 # Convert pl.po to create pl.UTF-8.po. |
127 pl.UTF-8.po: pl.po | 133 pl.UTF-8.po: pl.po |
128 rm -f pl.UTF-8.po | 134 rm -f pl.UTF-8.po |
129 iconv -f iso-8859-2 -t utf-8 pl.po | \ | 135 iconv -f ISO-8859-2 -t UTF-8 pl.po | \ |
130 $(SED) -e 's/charset=ISO-8859-2/charset=UTF-8/' -e 's/# Original translations/# Generated from pl.po, DO NOT EDIT/' > pl.UTF-8.po | 136 $(SED) -e 's/charset=[iI][sS][oO]-8859-2/charset=UTF-8/' \ |
137 -e 's/# Original translations/# Generated from pl.po, DO NOT EDIT/' \ | |
138 > pl.UTF-8.po | |
131 | 139 |
132 # Convert sk.po to create sk.cp1250.po. | 140 # Convert sk.po to create sk.cp1250.po. |
133 sk.cp1250.po: sk.po | 141 sk.cp1250.po: sk.po |
134 rm -f sk.cp1250.po | 142 rm -f sk.cp1250.po |
135 iconv -f iso-8859-2 -t cp1250 sk.po | \ | 143 iconv -f ISO-8859-2 -t CP1250 sk.po | \ |
136 $(SED) -e 's/charset=ISO-8859-2/charset=cp1250/' -e 's/# Original translations/# Generated from sk.po, DO NOT EDIT/' > sk.cp1250.po | 144 $(SED) -e 's/charset=[iI][sS][oO]-8859-2/charset=CP1250/' \ |
145 -e 's/# Original translations/# Generated from sk.po, DO NOT EDIT/' \ | |
146 > sk.cp1250.po | |
137 | 147 |
138 # Convert zh_CN.UTF-8.po to create zh_CN.po. | 148 # Convert zh_CN.UTF-8.po to create zh_CN.po. |
139 zh_CN.po: zh_CN.UTF-8.po | 149 zh_CN.po: zh_CN.UTF-8.po |
140 rm -f zh_CN.po | 150 rm -f zh_CN.po |
141 iconv -f UTF-8 -t gb2312 zh_CN.UTF-8.po | \ | 151 iconv -f UTF-8 -t GB2312 zh_CN.UTF-8.po | \ |
142 $(SED) -e 's/charset=[uU][tT][fF]-8/charset=gb2312/' -e 's/# Original translations/# Generated from zh_CN.UTF-8.po, DO NOT EDIT/' > zh_CN.po | 152 $(SED) -e 's/charset=[uU][tT][fF]-8/charset=GB2312/' \ |
153 -e 's/# Original translations/# Generated from zh_CN.UTF-8.po, DO NOT EDIT/' \ | |
154 > zh_CN.po | |
143 | 155 |
144 # Convert zh_CN.UTF-8.po to create zh_CN.cp936.po. | 156 # Convert zh_CN.UTF-8.po to create zh_CN.cp936.po. |
145 # Set 'charset' to gbk to avoid that msfmt generates a warning. | 157 # Set 'charset' to gbk to avoid that msfmt generates a warning. |
146 # This used to convert from zh_CN.po, but that results in a conversion error. | 158 # This used to convert from zh_CN.po, but that results in a conversion error. |
147 zh_CN.cp936.po: zh_CN.UTF-8.po | 159 zh_CN.cp936.po: zh_CN.UTF-8.po |
148 rm -f zh_CN.cp936.po | 160 rm -f zh_CN.cp936.po |
149 iconv -f UTF-8 -t cp936 zh_CN.UTF-8.po | \ | 161 iconv -f UTF-8 -t CP936 zh_CN.UTF-8.po | \ |
150 $(SED) -e 's/charset=[uU][tT][fF]-8/charset=gbk/' -e 's/# Original translations/# Generated from zh_CN.UTF-8.po, DO NOT EDIT/' > zh_CN.cp936.po | 162 $(SED) -e 's/charset=[uU][tT][fF]-8/charset=GBK/' \ |
163 -e 's/# Original translations/# Generated from zh_CN.UTF-8.po, DO NOT EDIT/' \ | |
164 > zh_CN.cp936.po | |
151 | 165 |
152 # Convert zh_TW.UTF-8.po to create zh_TW.po | 166 # Convert zh_TW.UTF-8.po to create zh_TW.po |
153 zh_TW.po: zh_TW.UTF-8.po | 167 zh_TW.po: zh_TW.UTF-8.po |
154 rm -f zh_TW.po | 168 rm -f zh_TW.po |
155 iconv -f UTF-8 -t big5 zh_TW.UTF-8.po | \ | 169 iconv -f UTF-8 -t BIG5 zh_TW.UTF-8.po | \ |
156 $(SED) -e 's/charset=[uU][tT][fF]-8/charset=big5/' -e 's/# Original translations/# Generated from zh_TW.UTF-8.po, DO NOT EDIT/' > zh_TW.po | 170 $(SED) -e 's/charset=[uU][tT][fF]-8/charset=BIG5/' \ |
171 -e 's/# Original translations/# Generated from zh_TW.UTF-8.po, DO NOT EDIT/' \ | |
172 > zh_TW.po | |
173 | |
174 | |
175 # Convert zh_TW.UTF-8.po to create zh_TW.po with backslash characters | |
176 # Requires doubling backslashes in the second byte. Don't depend on big5corr, | |
177 # it should only be compiled when zh_TW.po is outdated. | |
178 | |
179 # | |
180 # 06.11.23, added by Restorer | |
181 # For more details, see: | |
182 # https://github.com/vim/vim/pull/3261 | |
183 # https://github.com/vim/vim/pull/3476 | |
184 # https://github.com/vim/vim/pull/12153 | |
185 # (read all comments) | |
186 # | |
187 # I checked the workability on the list of backslash characters | |
188 # specified in zh_TW.UTF-8.po. It works. | |
189 # But it is better to have someone native speaker check it. | |
190 # | |
191 | |
192 #zh_TW.po: zh_TW.UTF-8.po | |
193 # @$(MAKE) big5corr | |
194 # rm -f zh_TW.po | |
195 # iconv -f UTF-8 -t BIG5 zh_TW.UTF-8.po | ./big5corr > zh_TW.po | |
196 | |
197 | |
198 # 06.11.23, added by Restorer | |
199 # see above in the zh_tw.po conversion section for backslashes. | |
200 #big5corr: big5corr.c | |
201 # $(CC) -o big5corr big5corr.c | |
202 | |
157 | 203 |
158 # Convert ko.UTF-8.po to create ko.po. | 204 # Convert ko.UTF-8.po to create ko.po. |
159 ko.po: ko.UTF-8.po | 205 ko.po: ko.UTF-8.po |
160 rm -f ko.po | 206 rm -f ko.po |
161 iconv -f UTF-8 -t euc-kr ko.UTF-8.po | \ | 207 iconv -f UTF-8 -t EUC-KR ko.UTF-8.po | \ |
162 $(SED) -e 's/charset=UTF-8/charset=euc-kr/' \ | 208 $(SED) -e 's/charset=[uU][tT][fF]-8/charset=EUC-KR/' \ |
163 -e 's/# Korean translation for Vim/# Generated from ko.UTF-8.po, DO NOT EDIT/' \ | 209 -e 's/# Original translations/# Generated from ko.UTF-8.po, DO NOT EDIT/' \ |
164 > ko.po | 210 > ko.po |
165 | 211 |
166 # Convert ru.po to create ru.cp1251.po. | 212 # Convert ru.po to create ru.cp1251.po. |
167 ru.cp1251.po: ru.po | 213 ru.cp1251.po: ru.po |
168 rm -f ru.cp1251.po | 214 rm -f ru.cp1251.po |
169 iconv -f utf-8 -t cp1251 ru.po | \ | 215 iconv -f UTF-8 -t CP1251 ru.po | \ |
170 $(SED) -e 's/charset=[uU][tT][fF]-8/charset=cp1251/' -e 's/# Original translations/# Generated from ru.po, DO NOT EDIT/' > ru.cp1251.po | 216 $(SED) -e 's/charset=[uU][tT][fF]-8/charset=CP1251/' \ |
217 -e 's/# Original translations/# Generated from ru.po, DO NOT EDIT/' \ | |
218 > ru.cp1251.po | |
171 | 219 |
172 # Convert uk.po to create uk.cp1251.po. | 220 # Convert uk.po to create uk.cp1251.po. |
173 uk.cp1251.po: uk.po | 221 uk.cp1251.po: uk.po |
174 rm -f uk.cp1251.po | 222 rm -f uk.cp1251.po |
175 iconv -f utf-8 -t cp1251 uk.po | \ | 223 iconv -f UTF-8 -t CP1251 uk.po | \ |
176 $(SED) -e 's/charset=[uU][tT][fF]-8/charset=cp1251/' -e 's/# Original translations/# Generated from uk.po, DO NOT EDIT/' > uk.cp1251.po | 224 $(SED) -e 's/charset=[uU][tT][fF]-8/charset=CP1251/' \ |
225 -e 's/# Original translations/# Generated from uk.po, DO NOT EDIT/' \ | |
226 > uk.cp1251.po | |
177 | 227 |
178 prefixcheck: | 228 prefixcheck: |
179 @if test "x" = "x$(prefix)"; then \ | 229 @if test "x" = "x$(prefix)"; then \ |
180 echo "******************************************"; \ | 230 echo "******************************************"; \ |
181 echo " please use make from the src directory "; \ | 231 echo " please use make from the src directory "; \ |
184 fi | 234 fi |
185 | 235 |
186 clean: checkclean | 236 clean: checkclean |
187 rm -f core core.* *.old.po *.mo *.pot sjiscorr | 237 rm -f core core.* *.old.po *.mo *.pot sjiscorr |
188 rm -f LINGUAS vim.desktop gvim.desktop tmp_*desktop | 238 rm -f LINGUAS vim.desktop gvim.desktop tmp_*desktop |
239 # rm -f big5corr | |
189 | 240 |
190 distclean: clean | 241 distclean: clean |
191 | 242 |
192 checkclean: | 243 checkclean: |
193 rm -f *.ck | 244 rm -f *.ck |
229 $(MSGFMT) --desktop -d . --template gvim.desktop.in -o tmp_gvim.desktop | 280 $(MSGFMT) --desktop -d . --template gvim.desktop.in -o tmp_gvim.desktop |
230 rm -f LINGUAS | 281 rm -f LINGUAS |
231 if command -v desktop-file-validate; then desktop-file-validate tmp_gvim.desktop; fi | 282 if command -v desktop-file-validate; then desktop-file-validate tmp_gvim.desktop; fi |
232 mv tmp_gvim.desktop gvim.desktop | 283 mv tmp_gvim.desktop gvim.desktop |
233 | 284 |
234 update-po: $(LANGUAGES) | 285 # When updating ja.sjis.po there are a bunch of errors and a crash. |
286 # The files that are converted to a different encoding clearly state "DO NOT EDIT". | |
287 update-po: $(MOFILES:.mo=) | |
235 | 288 |
236 # Don't add a dependency here, we only want to update the .po files manually | 289 # Don't add a dependency here, we only want to update the .po files manually |
237 $(LANGUAGES): | 290 $(LANGUAGES): |
238 @$(MAKE) $(PACKAGE).pot | 291 @$(MAKE) $(PACKAGE).pot |
239 if test ! -f $@.po.orig; then cp $@.po $@.po.orig; fi | 292 if test ! -f $@.po.orig; then cp $@.po $@.po.orig; fi |