Remove unused scripts
This commit is contained in:
parent
c89a3627ac
commit
215ad15beb
|
@ -290,7 +290,6 @@ build_front:
|
|||
- cd front
|
||||
script:
|
||||
- yarn install
|
||||
- yarn run i18n-compile
|
||||
# this is to ensure we don't have any errors in the output,
|
||||
# cf https://dev.funkwhale.audio/funkwhale/funkwhale/issues/169
|
||||
- yarn run build:deployment | tee /dev/stderr | (! grep -i 'ERROR in')
|
||||
|
|
|
@ -37,7 +37,6 @@ tasks:
|
|||
before: cd front
|
||||
init: |
|
||||
yarn install
|
||||
yarn run i18n-compile
|
||||
command: yarn dev --host 0.0.0.0 --base /front/
|
||||
|
||||
- name: Welcome to Funkwhale development!
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
"lint": "eslint --ext .ts,.js,.vue,.html src public/embed.html",
|
||||
"lint:tsc": "vue-tsc --noEmit",
|
||||
"fix-fomantic-css": "scripts/fix-fomantic-css.sh",
|
||||
"i18n-compile": "scripts/i18n-compile.sh",
|
||||
"i18n-extract": "scripts/i18n-extract.sh",
|
||||
"postinstall": "yarn run fix-fomantic-css"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
|
||||
cd "$(dirname "$0")/.." # change into base directory
|
||||
|
||||
npm_binaries() {
|
||||
if command -v yarn > /dev/null; then
|
||||
yarn bin
|
||||
else
|
||||
npm bin
|
||||
fi
|
||||
}
|
||||
|
||||
locales=$(jq -r '.[].code' src/locales.json | grep -v 'en_US')
|
||||
mkdir -p src/translations
|
||||
|
||||
for locale in $locales; do
|
||||
"$(npm_binaries)/gettext-compile" "locales/$locale/LC_MESSAGES/app.po" --output "src/translations/$locale.json"
|
||||
done
|
||||
|
||||
# find locales -name '*.po' | xargs "$(npm_binaries)/.bin/gettext-compile" --output src/translations.json
|
|
@ -1,54 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
|
||||
cd "$(dirname "$0")/.." # change into base directory
|
||||
|
||||
npm_binaries() {
|
||||
if command -v yarn > /dev/null; then
|
||||
yarn bin
|
||||
else
|
||||
npm bin
|
||||
fi
|
||||
}
|
||||
|
||||
locales=$(jq -r '.[].code' src/locales.json)
|
||||
locales_dir="locales"
|
||||
sources=$(find src -name '*.vue' -o -name '*.html' 2> /dev/null)
|
||||
js_sources=$(find src -name '*.vue' -o -name '*.js')
|
||||
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.
|
||||
# shellcheck disable=SC2086
|
||||
"$(npm_binaries)/gettext-extract" --attribute v-translate --quiet --output "$locales_dir/app.pot" $sources
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
xgettext --language=JavaScript --keyword=npgettext:1c,2,3 \
|
||||
--from-code=utf-8 --join-existing --no-wrap \
|
||||
--package-name="$(jq -r '.name' package.json)" \
|
||||
--package-version="$(jq -r '.version' package.json)" \
|
||||
--output "$locales_dir/app.pot" $js_sources \
|
||||
--no-wrap
|
||||
|
||||
# Fix broken files path/lines in pot
|
||||
sed -e 's|#: src/|#: front/src/|' -i "$locales_dir/app.pot"
|
||||
|
||||
if [ "$GENERATE" = 'true' ]; then
|
||||
# Generate .po files for each available language.
|
||||
echo "$locales"
|
||||
for lang in $locales; do
|
||||
po_file="$locales_dir/$lang/LC_MESSAGES/app.po"
|
||||
echo "msgmerge --update $po_file"
|
||||
mkdir -p "$(dirname "$po_file")"
|
||||
|
||||
if [[ -f "$po_file" ]]; then
|
||||
msgmerge --lang="$lang" --update "$po_file" "$locales_dir/app.pot" --no-wrap
|
||||
else
|
||||
msginit --no-wrap --no-translator --locale="$lang" --input="$locales_dir/app.pot" --output-file="$po_file"
|
||||
fi
|
||||
|
||||
msgattrib --no-wrap --no-obsolete -o "$po_file" "$po_file"
|
||||
done
|
||||
fi
|
|
@ -1,32 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import collections
|
||||
|
||||
import polib
|
||||
|
||||
|
||||
def print_duplicates(path):
|
||||
pofile = polib.pofile(path)
|
||||
|
||||
contexts_by_id = collections.defaultdict(list)
|
||||
for e in pofile:
|
||||
contexts_by_id[e.msgid].append(e.msgctxt)
|
||||
count = collections.Counter([e.msgid for e in pofile])
|
||||
duplicates = [(k, v) for k, v in count.items() if v > 1]
|
||||
for k, v in sorted(duplicates, key=lambda r: r[1], reverse=True):
|
||||
print(f"{v} entries - {k}:")
|
||||
for ctx in contexts_by_id[k]:
|
||||
print(f" - {ctx}")
|
||||
print()
|
||||
|
||||
total_duplicates = sum([v - 1 for _, v in duplicates])
|
||||
print(f"{total_duplicates} total duplicates")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("po", help="Path of the po file to use as a source")
|
||||
args = parser.parse_args()
|
||||
|
||||
print_duplicates(path=args.po)
|
Loading…
Reference in New Issue