Move locales.ts to locales.json and remove unused i18n script
This commit is contained in:
parent
e74a5c8e49
commit
71cd5edd2a
|
@ -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
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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;
|
|
@ -1,7 +1,4 @@
|
|||
import type { Locale } from '@/types'
|
||||
|
||||
/* eslint-disable */
|
||||
export const locales: Locale[] = [
|
||||
[
|
||||
{
|
||||
"code": "ar",
|
||||
"label": "العربية"
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue