mirror of
https://github.com/zotero/zotero.git
synced 2026-08-28 05:25:31 +00:00
Fix locale update script under rpl 2.x
rpl 2.1.0 guesses each file's character encoding instead of assuming UTF-8, and aborts on some locale files, leaving the script's later steps unrun. Pin the encoding, and use -exec + so a failure in one of these passes actually stops the script. Also drop the ⏎ replacement, which hasn't matched anything since 2013 and would now insert real newlines rather than literal \n, truncating .properties entries.
This commit is contained in:
parent
844bd87824
commit
5a6c9245f0
1 changed files with 5 additions and 7 deletions
|
|
@ -16,18 +16,16 @@ cp -R $LOCALES_DIR/en-US/zotero/* en-US-new
|
|||
cp -R $LOCALES_DIR/ locales/
|
||||
rm -rf locales/en-US
|
||||
# Correct various errors
|
||||
find locales -name '*.dtd' -exec perl -pi -e "s/&([^\s])/&\$1/g" {} \;
|
||||
find locales -name '*.properties' -exec rpl 'S%' '%S' {} \;
|
||||
find locales -name '*.properties' -exec rpl '/n' '\\n' {} \;
|
||||
find locales -name '*.properties' -exec rpl '\\\\' '\\' {} \;
|
||||
find locales -name '*.properties' -exec rpl '\\n\\n\\(?!n)' '\\n\\n' {} \;
|
||||
find locales -name '*.dtd' -exec perl -pi -e "s/&([^\s])/&\$1/g" {} +
|
||||
find locales -name '*.properties' -exec rpl --encoding=UTF-8 'S%' '%S' {} +
|
||||
find locales -name '*.properties' -exec rpl --encoding=UTF-8 '/n' '\\n' {} +
|
||||
find locales -name '*.properties' -exec rpl --encoding=UTF-8 '\\\\' '\\' {} +
|
||||
find locales -name '*.properties' -exec rpl --encoding=UTF-8 '\\n\\n\\(?!n)' '\\n\\n' {} +
|
||||
|
||||
# Run merge script
|
||||
$SCRIPT_DIR/localizer
|
||||
rsync -a --progress --verbose $WORK_DIR/output/locale/ $LOCALES_DIR/
|
||||
|
||||
rpl -R ⏎ '\n' "$LOCALES_DIR"
|
||||
|
||||
rm -rf en-US-new locales content-locales output
|
||||
|
||||
$SCRIPT_DIR/filter_connector_json "$LOCALES_DIR"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue