diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts
index 9992b9c44..e60a74cc0 100644
--- a/client/src/app/app.module.ts
+++ b/client/src/app/app.module.ts
@@ -69,7 +69,7 @@ export function metaFactory (serverService: ServerService): MetaLoader {
useFactory: (locale) => {
// On dev mode, test locales
if (environment.production === false && window.location.search === '?lang=fr') {
- return require(`raw-loader!../locale/target/messages_fr.xml`)
+ return require(`raw-loader!../locale/target/angular_fr.xml`)
}
const fileLocale = buildFileLocale(locale)
@@ -78,7 +78,7 @@ export function metaFactory (serverService: ServerService): MetaLoader {
const defaultFileLocale = buildFileLocale(getDefaultLocale())
if (fileLocale === defaultFileLocale) return ''
- return require(`raw-loader!../locale/target/messages_${fileLocale}.xml`)
+ return require(`raw-loader!../locale/target/angular_${fileLocale}.xml`)
},
deps: [ LOCALE_ID ]
},
diff --git a/client/src/locale/source/messages_en_US.xml b/client/src/locale/source/angular_en_US.xml
similarity index 100%
rename from client/src/locale/source/messages_en_US.xml
rename to client/src/locale/source/angular_en_US.xml
diff --git a/client/src/locale/target/messages_fr.xml b/client/src/locale/target/angular_fr.xml
similarity index 99%
rename from client/src/locale/target/messages_fr.xml
rename to client/src/locale/target/angular_fr.xml
index 04e9d2a1a..7861e4134 100644
--- a/client/src/locale/target/messages_fr.xml
+++ b/client/src/locale/target/angular_fr.xml
@@ -22,7 +22,7 @@
Edit
- Éditer
+ Modifier3
@@ -106,7 +106,7 @@
I forgot my password
- J'ai oublié mon mot de passe
+ J’ai oublié mon mot de passe42
@@ -120,14 +120,14 @@
Email
- Email
+ Courriel17Email address
- Adresse email
+ Courriel66
@@ -143,7 +143,7 @@
Reset my password
- Remettre à zéro mon mot de passe
+ Réinitialiser mon mot de passe2
@@ -313,7 +313,7 @@
Login
- Se connecter
+ Connexion34
@@ -1152,7 +1152,7 @@ Quand vous mettrez en ligne une vidéo sur cette chaîne, la vidéo affichera au
Change password
- Changer votre phrase de passe
+ Changer le mot de passe19
@@ -1268,7 +1268,7 @@ Quand vous mettrez en ligne une vidéo sur cette chaîne, la vidéo affichera au
Privacy
- Visibilité
+ Confidentialité86
@@ -1331,7 +1331,7 @@ Quand vous mettrez en ligne une vidéo sur cette chaîne, la vidéo affichera au
Language
- Langue
+ Langage72
@@ -1633,7 +1633,7 @@ Quand vous mettrez en ligne une vidéo sur cette chaîne, la vidéo affichera au
Show more
- Montrer plus
+ Voir plus112
@@ -1886,7 +1886,7 @@ Quand vous mettrez en ligne une vidéo sur cette chaîne, la vidéo affichera au
Success
- Succès
+ Réussite1
@@ -2882,7 +2882,7 @@ Quand vous mettrez en ligne une vidéo sur cette chaîne, la vidéo affichera au
Search
- Rechercher
+ Chercher1
diff --git a/client/src/main.ts b/client/src/main.ts
index 85c4c0672..19f45a3e3 100644
--- a/client/src/main.ts
+++ b/client/src/main.ts
@@ -12,7 +12,7 @@ if (environment.production) {
}
if (environment.production === false && window.location.search === '?lang=fr') {
- const translations = require(`raw-loader!./locale/target/messages_fr.xml`)
+ const translations = require(`raw-loader!./locale/target/angular_fr.xml`)
providers = [
{ provide: TRANSLATIONS, useValue: translations },
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts
index 3895b3b9d..d8a87f291 100755
--- a/scripts/i18n/create-custom-files.ts
+++ b/scripts/i18n/create-custom-files.ts
@@ -30,20 +30,25 @@ for (const sourceObject of [ videojs, playerKeys ]) {
Object.keys(sourceObject).forEach(k => obj.resources.namespace1[ k ] = { source: sourceObject[ k ] })
}
-jsToXliff12(obj, (err, res) => {
+saveToXliffFile(playerTarget, obj, err => {
if (err) {
console.error(err)
process.exit(-1)
}
- writeFile(playerTarget, res, err => {
- if (err) {
- console.error(err)
- process.exit(-1)
- }
-
- process.exit(0)
- })
+ process.exit(0)
})
// Then, the server strings
+
+function saveToXliffFile (targetPath: string, obj: any, cb: Function) {
+ jsToXliff12(obj, (err, res) => {
+ if (err) return cb(err)
+
+ writeFile(playerTarget, res, err => {
+ if (err) return cb(err)
+
+ return cb(null)
+ })
+ })
+}
diff --git a/scripts/i18n/generate.sh b/scripts/i18n/generate.sh
index 0a5b6dee1..f93d6cc03 100755
--- a/scripts/i18n/generate.sh
+++ b/scripts/i18n/generate.sh
@@ -3,13 +3,12 @@
set -eu
cd client
-npm run ng -- xi18n --i18n-locale "en-US" --output-path locale/source --out-file messages_en_US.xml
-npm run ngx-extractor -- --locale "en-US" -i 'src/**/*.ts' -f xlf -o src/locale/source/messages_en_US.xml
+npm run ng -- xi18n --i18n-locale "en-US" --output-path locale/source --out-file angular_en_US.xml
+npm run ngx-extractor -- --locale "en-US" -i 'src/**/*.ts' -f xlf -o src/locale/source/angular_en_US.xml
# Zanata does not support inner elements in , so we hack these special elements
# This regex translate the Angular elements to special entities (that we will reconvert on pull)
-#sed -i 's//\<x id=\1\/\>/g' src/locale/source/messages_en_US.xml
-perl -pi -e 's||<x id=\1/>|g' src/locale/source/messages_en_US.xml
+perl -pi -e 's||<x id=\1/>|g' src/locale/source/angular_en_US.xml
# Add our strings too
cd ../
diff --git a/scripts/i18n/pull-hook.sh b/scripts/i18n/pull-hook.sh
index dec426b88..3d57040cc 100755
--- a/scripts/i18n/pull-hook.sh
+++ b/scripts/i18n/pull-hook.sh
@@ -4,7 +4,6 @@ set -eu
# Zanata does not support inner elements in , so we hack these special elements
# This regex translate the converted elements to initial Angular elements
-#sed -i 's/\<x id=\(.\+\?\)\/\>//g' client/src/locale/target/*
for i in 1 2 3; do
perl -pi -e 's|<x id=(.+?)/>([^"])|\2|g' client/src/locale/target/*.xml