Commit 39405bbc authored by heyarne's avatar heyarne Committed by Georg Krause
Browse files

Make scripts more portable

parent 5fded7a7
Frontend build tooling is less dependent on `npm` or `yarn` being used (!1285)
#!/bin/bash -eux
#!/usr/bin/env -S bash -eux
cd "$(dirname $0)/.." # change into base directory
find node_modules/fomantic-ui-css/components -name "*.min.css" -delete
mkdir -p node_modules/fomantic-ui-css/tweaked
......
#!/bin/bash -eux
#!/usr/bin/env -S bash -eux
cd "$(dirname $0)/.." # change into base directory
source scripts/utils.sh
locales=$(tail -n +2 src/locales.js | sed -e 's/export default //' | jq '.locales[].code' | grep -v 'en_US' | xargs echo)
mkdir -p src/translations
for locale in $locales; do
$(yarn bin)/gettext-compile locales/$locale/LC_MESSAGES/app.po --output src/translations/$locale.json
$(npm_binaries)/gettext-compile locales/$locale/LC_MESSAGES/app.po --output src/translations/$locale.json
done
# find locales -name '*.po' | xargs $(yarn bin)/gettext-compile --output src/translations.json
# find locales -name '*.po' | xargs $(npm_binaries)/.bin/gettext-compile --output src/translations.json
#!/bin/bash -eux
#!/usr/bin/env -S bash -eux
cd "$(dirname $0)/.." # change into base directory
source scripts/utils.sh
locales=$(tail -n +2 src/locales.js | sed -e 's/export default //' | jq '.locales[].code' | xargs echo)
locales_dir="locales"
sources=$(find src -name '*.vue' -o -name '*.html' 2> /dev/null)
......@@ -7,7 +11,7 @@ touch $locales_dir/app.pot
GENERATE=${GENERATE-true}
# Create a main .pot template, then generate .po files for each available language.
# Extract gettext strings from templates files and create a POT dictionary template.
$(yarn bin)/gettext-extract --attribute v-translate --quiet --output $locales_dir/app.pot $sources
$(npm_binaries)/gettext-extract --attribute v-translate --quiet --output $locales_dir/app.pot $sources
xgettext --language=JavaScript --keyword=npgettext:1c,2,3 \
--from-code=utf-8 --join-existing --no-wrap \
--package-name=$(node -e "console.log(require('./package.json').name);") \
......
#!/bin/bash -eu
#!/usr/bin/env -S bash -eux
# Typical use:
# cp -r locales old_locales
......@@ -6,6 +6,8 @@
# ./scripts/i18n-populate-contextualized-strings.sh old_locales locales
# Then review/commit the changes
cd "$(dirname $0)/.." # change into base directory
old_locales_dir=$1
new_locales_dir=$2
......
#!/bin/bash -eux
#!/usr/bin/env -S bash -eux
integration_branch="translations-integration"
git remote add weblate https://translate.funkwhale.audio/git/funkwhale/front/ || echo "remote already exists"
git fetch weblate
......
#!/usr/bin/env bash -S -eux
npm_binaries () {
command -v yarn > /dev/null && yarn bin || npm bin
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment