Skip to content

Commit

Permalink
Merge pull request #156 from vim-jp/import-9.0.2127-scripts
Browse files Browse the repository at this point in the history
Import the lastest scripts from 9.0.2127
  • Loading branch information
k-takata authored Nov 27, 2023
2 parents a46ceff + cf1bf00 commit 7c2a74e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions src/po/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ MSGFMT = OLD_PO_FILE_INPUT=yes msgfmt

VIM = vim

# MacOS sed is locale aware, set $LANG to avoid problems
SED = LANG=C sed

.SUFFIXES: .po .mo .ck

test: check $(MOFILES)
Expand All @@ -39,11 +42,13 @@ update: ja.sjis.po ja.euc-jp.po
ja.sjis.po: $(MASTER_PO)
@$(MAKE) sjiscorr
rm -f $@
iconv -f utf-8 -t cp932 $< | ./sjiscorr > $@
iconv -f UTF-8 -t CP932 $< | ./sjiscorr > $@

ja.euc-jp.po: $(MASTER_PO)
iconv -f utf-8 -t euc-jp $< | \
sed -e 's/charset=[uU][tT][fF]-8/charset=euc-jp/' -e 's/# Original translations/# Generated from ja.po, DO NOT EDIT/' > $@
iconv -f UTF-8 -t EUC-JP $< | \
$(SED) -e 's/charset=[uU][tT][fF]-8/charset=EUC-JP/' \
-e 's/# Original translations/# Generated from ja.po, DO NOT EDIT/' \
> $@

sjiscorr: sjiscorr.c
$(CC) -o $@ $<
Expand Down
4 changes: 2 additions & 2 deletions src/po/sjiscorr.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ main(int argc, char **argv)
if (strncmp(p, "charset=utf-8", 13) == 0
|| strncmp(p, "charset=UTF-8", 13) == 0)
{
fputs("charset=cp932", stdout);
fputs("charset=CP932", stdout);
p += 12;
}
else if (strncmp(p, "# Original translations", 23) == 0)
{
fputs("# generated from ja.po, DO NOT EDIT", stdout);
fputs("# Generated from ja.po, DO NOT EDIT.", stdout);
while (p[1] != '\n')
++p;
}
Expand Down

0 comments on commit 7c2a74e

Please sign in to comment.