Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Rename messages locale to angular

Chocobozzzf07d6385b4b4
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts
index 9992b9c44e..e60a74cc02 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 04e9d2a1ab..7861e4134c 100644
--- a/client/src/locale/target/messages_fr.xml
+++ b/client/src/locale/target/angular_fr.xml
@@ -22,7 +22,7 @@
</trans-unit>
<trans-unit id="28f86ffd419b869711aa13f5e5ff54be6d70731c">
<source>Edit</source>
- <target>Éditer</target>
+ <target>Modifier</target>
<context-group name="null">
<context context-type="linenumber">3</context>
</context-group>
@@ -106,7 +106,7 @@
</trans-unit>
<trans-unit id="b87e81682959464211443afc3e23c506865d2eda">
<source>I forgot my password</source>
- <target>J'ai oublié mon mot de passe</target>
+ <target>J’ai oublié mon mot de passe</target>
<context-group name="null">
<context context-type="linenumber">42</context>
</context-group>
@@ -120,14 +120,14 @@
</trans-unit>
<trans-unit id="244aae9346da82b0922506c2d2581373a15641cc">
<source>Email</source>
- <target>Email</target>
+ <target>Courriel</target>
<context-group name="null">
<context context-type="linenumber">17</context>
</context-group>
</trans-unit>
<trans-unit id="69b6ac577a19acc39fc0c22342092f327fff2529">
<source>Email address</source>
- <target>Adresse email</target>
+ <target>Courriel</target>
<context-group name="null">
<context context-type="linenumber">66</context>
</context-group>
@@ -143,7 +143,7 @@
<source>
Reset my password
</source>
- <target>Remettre à zéro mon mot de passe</target>
+ <target>Réinitialiser mon mot de passe</target>
<context-group name="null">
<context context-type="linenumber">2</context>
</context-group>
@@ -313,7 +313,7 @@
</trans-unit>
<trans-unit id="6765b4c916060f6bc42d9bb69e80377dbcb5e4e9">
<source>Login</source>
- <target>Se connecter</target>
+ <target>Connexion</target>
<context-group name="null">
<context context-type="linenumber">34</context>
</context-group>
@@ -1152,7 +1152,7 @@ Quand vous mettrez en ligne une vidéo sur cette chaîne, la vidéo affichera au
</trans-unit>
<trans-unit id="739516c2ca75843d5aec9cf0e6b3e4335c4227b9">
<source>Change password</source>
- <target>Changer votre phrase de passe</target>
+ <target>Changer le mot de passe</target>
<context-group name="null">
<context context-type="linenumber">19</context>
</context-group>
@@ -1268,7 +1268,7 @@ Quand vous mettrez en ligne une vidéo sur cette chaîne, la vidéo affichera au
</trans-unit>
<trans-unit id="3c78b53bca33467190c0b7a01320bc093a2b1427">
<source>Privacy</source>
- <target>Visibilité</target>
+ <target>Confidentialité</target>
<context-group name="null">
<context context-type="linenumber">86</context>
</context-group>
@@ -1331,7 +1331,7 @@ Quand vous mettrez en ligne une vidéo sur cette chaîne, la vidéo affichera au
</trans-unit>
<trans-unit id="fe46ccaae902ce974e2441abe752399288298619">
<source>Language</source>
- <target>Langue</target>
+ <target>Langage</target>
<context-group name="null">
<context context-type="linenumber">72</context>
</context-group>
@@ -1633,7 +1633,7 @@ Quand vous mettrez en ligne une vidéo sur cette chaîne, la vidéo affichera au
</trans-unit>
<trans-unit id="f0c5f6f270e70cbe063b5368fcf48f9afc1abd9b">
<source>Show more</source>
- <target>Montrer plus</target>
+ <target>Voir plus</target>
<context-group name="null">
<context context-type="linenumber">112</context>
</context-group>
@@ -1886,7 +1886,7 @@ Quand vous mettrez en ligne une vidéo sur cette chaîne, la vidéo affichera au
</trans-unit>
<trans-unit id="1e035e6ccfab771cad4226b2ad230cb0d4a88cba">
<source>Success</source>
- <target>Succès</target>
+ <target>Réussite</target>
<context-group name="null">
<context context-type="linenumber">1</context>
</context-group>
@@ -2882,7 +2882,7 @@ Quand vous mettrez en ligne une vidéo sur cette chaîne, la vidéo affichera au
</trans-unit>
<trans-unit id="7e892ba15f2c6c17e83510e273b3e10fc32ea016">
<source>Search</source>
- <target>Rechercher</target>
+ <target>Chercher</target>
<context-group name="null">
<context context-type="linenumber">1</context>
</context-group>
diff --git a/client/src/main.ts b/client/src/main.ts
index 85c4c0672a..19f45a3e30 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 3895b3b9d7..d8a87f2915 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 0a5b6dee16..f93d6cc03d 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 <source>, 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=\(.\+\?\)\/>/\&lt;x id=\1\/\&gt;/g' src/locale/source/messages_en_US.xml
-perl -pi -e 's|<x id=(.+?)/>|&lt;x id=\1/&gt;|g' src/locale/source/messages_en_US.xml
+perl -pi -e 's|<x id=(.+?)/>|&lt;x id=\1/&gt;|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 dec426b88e..3d57040cc0 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 <source>, so we hack these special elements
# This regex translate the converted elements to initial Angular elements
-#sed -i 's/\&lt;x id=\(.\+\?\)\/\&gt;/<x id=\1\/>/g' client/src/locale/target/*
for i in 1 2 3; do
perl -pi -e 's|&lt;x id=(.+?)/&gt;([^"])|<x id=\1/>\2|g' client/src/locale/target/*.xml