Move locales.ts to locales.json and remove unused i18n script

environments/review-front-deve-otr6gc/deployments/13401
Kasper Seweryn 2022-04-21 17:25:28 +02:00 zatwierdzone przez Georg Krause
rodzic 0732bc36a8
commit a7cc3de3f3
8 zmienionych plików z 2924 dodań i 2950 usunięć

Wyświetl plik

@ -28,7 +28,7 @@ Submitting a new language
1. Pull the latest version of ``develop``
2. Create a new branch, e.g ``git checkout -b translations-new-fr-ca``
3. Add your new language code and name in ``front/src/locales.ts``. Use the native language name, as it is what appears in the UI selector.
3. Add your new language code and name in ``front/src/locales.json``. Use the native language name, as it is what appears in the UI selector.
4. Create the ``po`` file from template:
.. code-block:: shell

Plik diff jest za duży Load Diff

Wyświetl plik

@ -3,7 +3,7 @@
cd "$(dirname $0)/.." # change into base directory
source scripts/utils.sh
locales=$(tail -n +3 src/locales.ts | sed -E 's/^[^[]+\[] =//' | jq -r '.[].code' | grep -v 'en_US')
locales=$(jq -r '.[].code' src/locales.json | grep -v 'en_US')
mkdir -p src/translations
for locale in $locales; do

Wyświetl plik

@ -3,7 +3,7 @@
cd "$(dirname $0)/.." # change into base directory
source scripts/utils.sh
locales=$(tail -n +3 src/locales.ts | sed -E 's/^[^[]+\[] =//' | jq -r '.[].code')
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')

Wyświetl plik

@ -1,23 +0,0 @@
#!/usr/bin/env -S bash -eux
# Typical use:
# cp -r locales old_locales
# ./scripts/i18n-extract.sh
# ./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
locales=$(tail -n +3 src/locales.ts | sed -E 's/^[^[]+\[] =//' | jq -r '.[].code')
# Generate .po files for each available language.
echo $locales
for lang in $locales; do
echo "Fixing contexts for $lang"
old_po_file=$old_locales_dir/$lang/LC_MESSAGES/app.po
new_po_file=$new_locales_dir/$lang/LC_MESSAGES/app.po
python3 ./scripts/contextualize.py $old_po_file $new_po_file --no-dry-run
done;

Wyświetl plik

@ -1,7 +1,4 @@
import type { Locale } from '@/types'
/* eslint-disable */
export const locales: Locale[] = [
[
{
"code": "ar",
"label": "العربية"

Wyświetl plik

@ -1,6 +1,6 @@
import Vue from 'vue'
import GetText from 'vue-gettext'
import { locales } from '@/locales'
import locales from '@/locales.json'
import { usePreferredLanguages } from '@vueuse/core'
import { watch } from '@vue/composition-api'
import { AppModule } from '@/types'

Wyświetl plik

@ -27,12 +27,6 @@ export interface ThemeEntry {
key: Theme
}
// Locale stuff
export interface Locale {
label: string
code: string
}
// Track stuff
export interface Artist {
name: string