Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

You may backport new translations for modules that have already been released.

A FOLIO release like Honeysuckle, Iris, etc. ships with the translations that come with each front-end module. Each front-end module has a different release date (Honeysuckle example). This is the time when translations are taken from module's GitHub translations directory and is different for each front-end module. A new front-end module release is needed to get more recent translation included into a FOLIO release.

However, the sysOp of a FOLIO installation may manually update the translations of their installation by exchanging the files in the /translations/ directory from where the static files are shipped.

One option is to take the latest translations from https://folio-testing.dev.folio.org/ .

Manual

Do to it manually use the browser developer tools to find out the current number folio-testing uses, for example https://folio-testing.dev.folio.org/translations/de-1605513539114.json. If you 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:

translations-upgrade
#!/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

BUNDLE=$(curl -s https://folio-testing.dev.folio.org/ | sed -n -E '/.*"\/(bundle\.[0-9a-z]+\.js)".*/{s//\1/p;q}')
echo $BUNDLE

N=$(curl -s https://folio-testing.dev.folio.org/$BUNDLE | sed -n -E '/.*"\/translations\/en-([0-9]+)\.json".*/{s//\1/p;q}')

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
  echo "https://folio-testing.dev.folio.org/translations/$LANG-$N.json"
  curl -s https://folio-testing.dev.folio.org/translations/$LANG-$N.json > $LANG.json
  jq -s '.[0] * .[1]' $file $LANG.json > $LANG.json.new
  mv $LANG.json.new $file
  rm $LANG.json
done
  • No labels