mirror of https://github.com/Chocobozzz/PeerTube
Rename messages locale to angular
parent
e945b184a0
commit
f07d6385b4
|
@ -69,7 +69,7 @@ export function metaFactory (serverService: ServerService): MetaLoader {
|
||||||
useFactory: (locale) => {
|
useFactory: (locale) => {
|
||||||
// On dev mode, test locales
|
// On dev mode, test locales
|
||||||
if (environment.production === false && window.location.search === '?lang=fr') {
|
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)
|
const fileLocale = buildFileLocale(locale)
|
||||||
|
@ -78,7 +78,7 @@ export function metaFactory (serverService: ServerService): MetaLoader {
|
||||||
const defaultFileLocale = buildFileLocale(getDefaultLocale())
|
const defaultFileLocale = buildFileLocale(getDefaultLocale())
|
||||||
if (fileLocale === defaultFileLocale) return ''
|
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 ]
|
deps: [ LOCALE_ID ]
|
||||||
},
|
},
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="28f86ffd419b869711aa13f5e5ff54be6d70731c">
|
<trans-unit id="28f86ffd419b869711aa13f5e5ff54be6d70731c">
|
||||||
<source>Edit</source>
|
<source>Edit</source>
|
||||||
<target>Éditer</target>
|
<target>Modifier</target>
|
||||||
<context-group name="null">
|
<context-group name="null">
|
||||||
<context context-type="linenumber">3</context>
|
<context context-type="linenumber">3</context>
|
||||||
</context-group>
|
</context-group>
|
||||||
|
@ -106,7 +106,7 @@
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="b87e81682959464211443afc3e23c506865d2eda">
|
<trans-unit id="b87e81682959464211443afc3e23c506865d2eda">
|
||||||
<source>I forgot my password</source>
|
<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-group name="null">
|
||||||
<context context-type="linenumber">42</context>
|
<context context-type="linenumber">42</context>
|
||||||
</context-group>
|
</context-group>
|
||||||
|
@ -120,14 +120,14 @@
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="244aae9346da82b0922506c2d2581373a15641cc">
|
<trans-unit id="244aae9346da82b0922506c2d2581373a15641cc">
|
||||||
<source>Email</source>
|
<source>Email</source>
|
||||||
<target>Email</target>
|
<target>Courriel</target>
|
||||||
<context-group name="null">
|
<context-group name="null">
|
||||||
<context context-type="linenumber">17</context>
|
<context context-type="linenumber">17</context>
|
||||||
</context-group>
|
</context-group>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="69b6ac577a19acc39fc0c22342092f327fff2529">
|
<trans-unit id="69b6ac577a19acc39fc0c22342092f327fff2529">
|
||||||
<source>Email address</source>
|
<source>Email address</source>
|
||||||
<target>Adresse email</target>
|
<target>Courriel</target>
|
||||||
<context-group name="null">
|
<context-group name="null">
|
||||||
<context context-type="linenumber">66</context>
|
<context context-type="linenumber">66</context>
|
||||||
</context-group>
|
</context-group>
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
<source>
|
<source>
|
||||||
Reset my password
|
Reset my password
|
||||||
</source>
|
</source>
|
||||||
<target>Remettre à zéro mon mot de passe</target>
|
<target>Réinitialiser mon mot de passe</target>
|
||||||
<context-group name="null">
|
<context-group name="null">
|
||||||
<context context-type="linenumber">2</context>
|
<context context-type="linenumber">2</context>
|
||||||
</context-group>
|
</context-group>
|
||||||
|
@ -313,7 +313,7 @@
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="6765b4c916060f6bc42d9bb69e80377dbcb5e4e9">
|
<trans-unit id="6765b4c916060f6bc42d9bb69e80377dbcb5e4e9">
|
||||||
<source>Login</source>
|
<source>Login</source>
|
||||||
<target>Se connecter</target>
|
<target>Connexion</target>
|
||||||
<context-group name="null">
|
<context-group name="null">
|
||||||
<context context-type="linenumber">34</context>
|
<context context-type="linenumber">34</context>
|
||||||
</context-group>
|
</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>
|
||||||
<trans-unit id="739516c2ca75843d5aec9cf0e6b3e4335c4227b9">
|
<trans-unit id="739516c2ca75843d5aec9cf0e6b3e4335c4227b9">
|
||||||
<source>Change password</source>
|
<source>Change password</source>
|
||||||
<target>Changer votre phrase de passe</target>
|
<target>Changer le mot de passe</target>
|
||||||
<context-group name="null">
|
<context-group name="null">
|
||||||
<context context-type="linenumber">19</context>
|
<context context-type="linenumber">19</context>
|
||||||
</context-group>
|
</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>
|
||||||
<trans-unit id="3c78b53bca33467190c0b7a01320bc093a2b1427">
|
<trans-unit id="3c78b53bca33467190c0b7a01320bc093a2b1427">
|
||||||
<source>Privacy</source>
|
<source>Privacy</source>
|
||||||
<target>Visibilité</target>
|
<target>Confidentialité</target>
|
||||||
<context-group name="null">
|
<context-group name="null">
|
||||||
<context context-type="linenumber">86</context>
|
<context context-type="linenumber">86</context>
|
||||||
</context-group>
|
</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>
|
||||||
<trans-unit id="fe46ccaae902ce974e2441abe752399288298619">
|
<trans-unit id="fe46ccaae902ce974e2441abe752399288298619">
|
||||||
<source>Language</source>
|
<source>Language</source>
|
||||||
<target>Langue</target>
|
<target>Langage</target>
|
||||||
<context-group name="null">
|
<context-group name="null">
|
||||||
<context context-type="linenumber">72</context>
|
<context context-type="linenumber">72</context>
|
||||||
</context-group>
|
</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>
|
||||||
<trans-unit id="f0c5f6f270e70cbe063b5368fcf48f9afc1abd9b">
|
<trans-unit id="f0c5f6f270e70cbe063b5368fcf48f9afc1abd9b">
|
||||||
<source>Show more</source>
|
<source>Show more</source>
|
||||||
<target>Montrer plus</target>
|
<target>Voir plus</target>
|
||||||
<context-group name="null">
|
<context-group name="null">
|
||||||
<context context-type="linenumber">112</context>
|
<context context-type="linenumber">112</context>
|
||||||
</context-group>
|
</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>
|
||||||
<trans-unit id="1e035e6ccfab771cad4226b2ad230cb0d4a88cba">
|
<trans-unit id="1e035e6ccfab771cad4226b2ad230cb0d4a88cba">
|
||||||
<source>Success</source>
|
<source>Success</source>
|
||||||
<target>Succès</target>
|
<target>Réussite</target>
|
||||||
<context-group name="null">
|
<context-group name="null">
|
||||||
<context context-type="linenumber">1</context>
|
<context context-type="linenumber">1</context>
|
||||||
</context-group>
|
</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>
|
||||||
<trans-unit id="7e892ba15f2c6c17e83510e273b3e10fc32ea016">
|
<trans-unit id="7e892ba15f2c6c17e83510e273b3e10fc32ea016">
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
<target>Rechercher</target>
|
<target>Chercher</target>
|
||||||
<context-group name="null">
|
<context-group name="null">
|
||||||
<context context-type="linenumber">1</context>
|
<context context-type="linenumber">1</context>
|
||||||
</context-group>
|
</context-group>
|
|
@ -12,7 +12,7 @@ if (environment.production) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (environment.production === false && window.location.search === '?lang=fr') {
|
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 = [
|
providers = [
|
||||||
{ provide: TRANSLATIONS, useValue: translations },
|
{ provide: TRANSLATIONS, useValue: translations },
|
||||||
|
|
|
@ -30,20 +30,25 @@ for (const sourceObject of [ videojs, playerKeys ]) {
|
||||||
Object.keys(sourceObject).forEach(k => obj.resources.namespace1[ k ] = { source: sourceObject[ k ] })
|
Object.keys(sourceObject).forEach(k => obj.resources.namespace1[ k ] = { source: sourceObject[ k ] })
|
||||||
}
|
}
|
||||||
|
|
||||||
jsToXliff12(obj, (err, res) => {
|
saveToXliffFile(playerTarget, obj, err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
process.exit(-1)
|
process.exit(-1)
|
||||||
}
|
}
|
||||||
|
|
||||||
writeFile(playerTarget, res, err => {
|
process.exit(0)
|
||||||
if (err) {
|
|
||||||
console.error(err)
|
|
||||||
process.exit(-1)
|
|
||||||
}
|
|
||||||
|
|
||||||
process.exit(0)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Then, the server strings
|
// 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)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -3,13 +3,12 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
cd client
|
cd client
|
||||||
npm run ng -- xi18n --i18n-locale "en-US" --output-path locale/source --out-file 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/messages_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
|
# 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)
|
# This regex translate the Angular elements to special entities (that we will reconvert on pull)
|
||||||
#sed -i 's/<x id=\(.\+\?\)\/>/\<x id=\1\/\>/g' src/locale/source/messages_en_US.xml
|
perl -pi -e 's|<x id=(.+?)/>|<x id=\1/>|g' src/locale/source/angular_en_US.xml
|
||||||
perl -pi -e 's|<x id=(.+?)/>|<x id=\1/>|g' src/locale/source/messages_en_US.xml
|
|
||||||
|
|
||||||
# Add our strings too
|
# Add our strings too
|
||||||
cd ../
|
cd ../
|
||||||
|
|
|
@ -4,7 +4,6 @@ set -eu
|
||||||
|
|
||||||
# Zanata does not support inner elements in <source>, so we hack these special elements
|
# Zanata does not support inner elements in <source>, so we hack these special elements
|
||||||
# This regex translate the converted elements to initial Angular elements
|
# This regex translate the converted elements to initial Angular elements
|
||||||
#sed -i 's/\<x id=\(.\+\?\)\/\>/<x id=\1\/>/g' client/src/locale/target/*
|
|
||||||
|
|
||||||
for i in 1 2 3; do
|
for i in 1 2 3; do
|
||||||
perl -pi -e 's|<x id=(.+?)/>([^"])|<x id=\1/>\2|g' client/src/locale/target/*.xml
|
perl -pi -e 's|<x id=(.+?)/>([^"])|<x id=\1/>\2|g' client/src/locale/target/*.xml
|
||||||
|
|
Loading…
Reference in New Issue