...
One option is to take the latest translations from https://folio-testingsnapshot.dev.folio.org/, another option is to take the translation files from https://github.com/gbv/folio-translations.
Manual
Do to it manually use the browser developer tools to find out the current number folio-testing uses, for example Option 1: Take the file from https://github.com/gbv/folio-testing.dev.folio.org/translations/de-1605513539114translations platform-complete directory, for example de.json. If you your own installation has de-1601343197440.json
merge them:jq -s '.[0] * .[1]'
de-1601343197440.json de-1605513539114.json > de-1601343197440.json.new
Then use the joined file: mv de-1601343197440.json.new de-1601343197440.json
Automated
To do it automatically use this script:
Code Block | ||||
---|---|---|---|---|
| ||||
#!/bin/sh
# Before running this script change into the ./translations directory where the web server (nginx, ...)
# ships the /translations/*.json files from, for example
# cd /usr/folio/folio-testing-platform/output/translations
set -e
for FILE in ./*-*.json ; do
if [ ! -e "$FILE" ] ; then
continue
fi
LANG=$(echo "$FILE" | sed -n -E '/^.\/([^-]+)-[0-9]+\.json$/{s//\1/p;q}')
if [ -z $LANG ] ; then
continue
fi
URL="https://raw.githubusercontent.com/gbv/folio-translations/main/platform-complete/$LANG.json"
if wget "$URL" -O $LANG.json; then
echo "$URL"
else
echo "failure, skipping $URL"
continue
fi
jq -c -s '.[0] * .[1]' $FILE $LANG.json > $LANG.json.new
mv $LANG.json.new $FILE
rm $LANG.json
done |
Option 2: Use the browser developer tools to find out the current number folio-snapshot uses, for example https://folio-snapshot.dev.folio.org/translations/de-1605513539114.json
. Download it. If your own installation has de-1601343197440.json
merge them:jq -s '.[0] * .[1]'
de-1601343197440.json de-1605513539114.json > de-1601343197440.json.new
Then use the joined file: mv de-1601343197440.json.new de-1601343197440.json
Automated
https://github.com/gbv/folio-translationsTo remove new translation keys replace'.[0] * .[1]'
by'.[0] as $old | .[0] * .[1] | with_entries( select( .key as $key | $old | has( $key ) ) )'
but this may remove a key that the old code uses and was forgotten to get added to the old language file.
Clean backport using yarn build
...