1
0
Fork 0

Try new worflow with french

This commit is contained in:
Chocobozzz 2019-11-07 09:45:14 +01:00
parent c2368b7241
commit 3aea8eb2e7
No known key found for this signature in database
GPG key ID: 583A612D890159BE
14 changed files with 9425 additions and 933 deletions

View file

@ -78,6 +78,13 @@
"with": "src/environments/environment.e2e.ts"
}
]
},
"fr_FR": {
"aot": true,
"outputPath": "dist/PeerTube-fr_FR",
"i18nFile": "src/i18n/messages.fr_FR.xlf",
"i18nFormat": "xlf",
"i18nLocale": "fr_FR"
}
}
},
@ -99,6 +106,9 @@
"e2e": {
"browserTarget": "PeerTube:build:e2e",
"proxyConfig": "e2e/proxy.config.json"
},
"fr_FR": {
"browserTarget": "PeerTube:build:fr_FR"
}
}
},
@ -135,6 +145,23 @@
"**/node_modules/**"
]
}
},
"xliffmerge": {
"builder": "@ngx-i18nsupport/tooling:xliffmerge",
"options": {
"xliffmergeOptions": {
"i18nFormat": "xlf",
"srcDir": "src/locale",
"genDir": "src/locale",
"useSourceAsTarget": false,
"i18nBaseFile": "angular",
"defaultLanguage": "en-US",
"languages": [
"en-US",
"fr-FR"
]
}
}
}
}
},

View file

@ -48,6 +48,7 @@
"@angularclass/hmr": "^2.1.3",
"@neos21/bootstrap3-glyphicons": "^1.0.1",
"@ng-bootstrap/ng-bootstrap": "^5.1.0",
"@ngx-i18nsupport/ngx-i18nsupport": "^1.1.6",
"@ngx-loading-bar/core": "^4.2.0",
"@ngx-loading-bar/http-client": "^4.2.0",
"@ngx-loading-bar/router": "^4.2.0",
@ -131,5 +132,8 @@
"webtorrent": "^0.107.16",
"whatwg-fetch": "^3.0.0",
"zone.js": "~0.10.0"
},
"dependencies": {
"@ngx-i18nsupport/tooling": "^8.0.3"
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
{"Quality":"Quality","Auto":"Auto","Speed":"Speed","Subtitles/CC":"Subtitles/CC","peers":"peers","peer":"peer","Go to the video page":"Go to the video page","Settings":"Settings","Uses P2P, others may know you are watching this video.":"Uses P2P, others may know you are watching this video.","Copy the video URL":"Copy the video URL","Copy the video URL at the current time":"Copy the video URL at the current time","Copy embed code":"Copy embed code","Copy magnet URI":"Copy magnet URI","Total downloaded: ":"Total downloaded: ","Total uploaded: ":"Total uploaded: ","Audio Player":"Audio Player","Video Player":"Video Player","Play":"Play","Pause":"Pause","Replay":"Replay","Current Time":"Current Time","Duration":"Duration","Remaining Time":"Remaining Time","Stream Type":"Stream Type","LIVE":"LIVE","Loaded":"Loaded","Progress":"Progress","Progress Bar":"Progress Bar","progress bar timing: currentTime={1} duration={2}":"{1} of {2}","Fullscreen":"Fullscreen","Non-Fullscreen":"Non-Fullscreen","Mute":"Mute","Unmute":"Unmute","Playback Rate":"Playback Rate","Subtitles":"Subtitles","subtitles off":"subtitles off","Captions":"Captions","captions off":"captions off","Chapters":"Chapters","Descriptions":"Descriptions","descriptions off":"descriptions off","Audio Track":"Audio Track","Volume Level":"Volume Level","You aborted the media playback":"You aborted the media playback","A network error caused the media download to fail part-way.":"A network error caused the media download to fail part-way.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"The media could not be loaded, either because the server or network failed or because the format is not supported.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.","No compatible source was found for this media.":"No compatible source was found for this media.","The media is encrypted and we do not have the keys to decrypt it.":"The media is encrypted and we do not have the keys to decrypt it.","Play Video":"Play Video","Close":"Close","Close Modal Dialog":"Close Modal Dialog","Modal Window":"Modal Window","This is a modal window":"This is a modal window","This modal can be closed by pressing the Escape key or activating the close button.":"This modal can be closed by pressing the Escape key or activating the close button.",", opens captions settings dialog":", opens captions settings dialog",", opens subtitles settings dialog":", opens subtitles settings dialog",", opens descriptions settings dialog":", opens descriptions settings dialog",", selected":", selected","captions settings":"captions settings","subtitles settings":"subititles settings","descriptions settings":"descriptions settings","Text":"Text","White":"White","Black":"Black","Red":"Red","Green":"Green","Blue":"Blue","Yellow":"Yellow","Magenta":"Magenta","Cyan":"Cyan","Background":"Background","Window":"Window","Transparent":"Transparent","Semi-Transparent":"Semi-Transparent","Opaque":"Opaque","Font Size":"Font Size","Text Edge Style":"Text Edge Style","None":"None","Raised":"Raised","Depressed":"Depressed","Uniform":"Uniform","Dropshadow":"Dropshadow","Font Family":"Font Family","Proportional Sans-Serif":"Proportional Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportional Serif","Monospace Serif":"Monospace Serif","Casual":"Casual","Script":"Script","Small Caps":"Small Caps","Reset":"Reset","restore all settings to the default values":"restore all settings to the default values","Done":"Done","Caption Settings Dialog":"Caption Settings Dialog","Beginning of dialog window. Escape will cancel and close the window.":"Beginning of dialog window. Escape will cancel and close the window.","End of dialog window.":"End of dialog window.","{1} is loading.":"{1} is loading."}

View file

@ -1 +0,0 @@
{"Audio Player":"Lecteur audio","Video Player":"Lecteur vidéo","Play":"Lecture","Pause":"Pause","Replay":"Revoir","Current Time":"Temps actuel","Duration":"Durée","Remaining Time":"Temps restant","Stream Type":"Type de flux","LIVE":"EN DIRECT","Loaded":"Chargé","Progress":"Progression","Progress Bar":"Barre de progression","progress bar timing: currentTime={1} duration={2}":"{1} de {2}","Fullscreen":"Plein écran","Non-Fullscreen":"Fenêtré","Mute":"Couper le son","Unmute":"Activer le son","Playback Rate":"Vitesse de lecture","Subtitles":"Sous-titres","subtitles off":"Sous-titres désactivés","Captions":"Sous-titres transcrits","captions off":"Sous-titres transcrits désactivés","Chapters":"Chapitres","Descriptions":"Descriptions","descriptions off":"descriptions désactivées","Audio Track":"Piste audio","Volume Level":"Niveau de volume","You aborted the media playback":"Vous avez interrompu la lecture de la vidéo","A network error caused the media download to fail part-way.":"Une erreur de réseau a interrompu le téléchargement de la vidéo.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Cette vidéo n'a pas pu être chargée, soit parce que le serveur ou le réseau a échoué ou parce que le format n'est pas reconnu.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"La lecture de la vidéo a été interrompue à cause d'un problème de corruption ou parce que la vidéo utilise des fonctionnalités non prises en charge par votre navigateur.","No compatible source was found for this media.":"Aucune source compatible n'a été trouvée pour cette vidéo.","The media is encrypted and we do not have the keys to decrypt it.":"Le média est chiffré et nous n'avons pas les clés pour le déchiffrer.","Play Video":"Lire la vidéo","Close":"Fermer","Close Modal Dialog":"Fermer la boîte de dialogue modale","Modal Window":"Fenêtre modale","This is a modal window":"Ceci est une fenêtre modale","This modal can be closed by pressing the Escape key or activating the close button.":"Ce modal peut être fermé en appuyant sur la touche Échap ou en cliquant sur le bouton de fermeture.",", opens captions settings dialog":", ouvrir les paramètres des sous-titres transcrits",", opens subtitles settings dialog":", ouvrir les paramètres des sous-titres",", opens descriptions settings dialog":", ouvrir les paramètres des descriptions",", selected":", sélectionné","captions settings":"Paramètres des sous-titres transcrits","subtitles settings":"Paramètres des sous-titres","descriptions settings":"Paramètres des descriptions","Text":"Texte","White":"Blanc","Black":"Noir","Red":"Rouge","Green":"Vert","Blue":"Bleu","Yellow":"Jaune","Magenta":"Magenta","Cyan":"Cyan","Background":"Arrière-plan","Window":"Fenêtre","Transparent":"Transparent","Semi-Transparent":"Semi-transparent","Opaque":"Opaque","Font Size":"Taille des caractères","Text Edge Style":"Style des contours du texte","None":"Aucun","Raised":"Élevé","Depressed":"Enfoncé","Uniform":"Uniforme","Dropshadow":"Ombre portée","Font Family":"Familles de polices","Proportional Sans-Serif":"Polices à chasse variable sans empattement (Proportional Sans-Serif)","Monospace Sans-Serif":"Polices à chasse fixe sans empattement (Monospace Sans-Serif)","Proportional Serif":"Polices à chasse variable avec empattement (Proportional Serif)","Monospace Serif":"Polices à chasse fixe avec empattement (Monospace Serif)","Casual":"Manuscrite","Script":"Script","Small Caps":"Petites capitales","Reset":"Réinitialiser","restore all settings to the default values":"Restaurer tous les paramètres aux valeurs par défaut","Done":"Terminé","Caption Settings Dialog":"Boîte de dialogue des paramètres des sous-titres transcrits","Beginning of dialog window. Escape will cancel and close the window.":"Début de la fenêtre de dialogue. La touche d'échappement annulera et fermera la fenêtre.","End of dialog window.":"Fin de la fenêtre de dialogue.","{1} is loading.":"{1} est en train de charger","Quality":"Qualité","Auto":"Auto","Speed":"Vitesse","Subtitles/CC":"Sous-titres/CC","peers":"pairs","peer":"pair","Go to the video page":"Aller sur la page de la vidéo","Settings":"Paramètres","Uses P2P, others may know you are watching this video.":"Utilise le P2P, d'autres personnes pourraient savoir que vous regardez cette vidéo.","Copy the video URL":"Copier le lien de la vidéo","Copy the video URL at the current time":"Copier le lien de la vidéo à partir de cette séquence","Copy embed code":"Copier le code d'intégration","Copy magnet URI":"Copier le magnet URL","Total downloaded: ":"Total téléchargé","Total uploaded: ":"Total téléversé"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -899,6 +899,35 @@
tree-kill "1.2.1"
webpack-sources "1.4.3"
"@ngx-i18nsupport/ngx-i18nsupport-lib@^1.12.1":
version "1.12.1"
resolved "https://registry.yarnpkg.com/@ngx-i18nsupport/ngx-i18nsupport-lib/-/ngx-i18nsupport-lib-1.12.1.tgz#4ecb2227c576dac51d75b3ef82b9962be7d87ef5"
integrity sha512-6HSv4lPZLYSkghprg4k0kKCaAGbsppK6vlAVswDkPHO659WnIkNpZYSloQPziFt6NqL9WpZJ3V1gBbVx9tKV0g==
dependencies:
"@types/xmldom" "^0.1.29"
tokenizr "^1.3.10"
tslib "^1.9.0"
xmldom "^0.1.27"
"@ngx-i18nsupport/ngx-i18nsupport@^1.1.6":
version "1.1.6"
resolved "https://registry.yarnpkg.com/@ngx-i18nsupport/ngx-i18nsupport/-/ngx-i18nsupport-1.1.6.tgz#d53ffd7e7b54cb8ba404db151bca3b68034a84eb"
integrity sha512-YQDOsz2FOdALOoQEQtsYZVnNuxi3qFKJ+n+lDm8uFjRIYegHXKD6m1i7nTGX+NEIr/0ICnWS3yPCyCy5x+6+hg==
dependencies:
"@ngx-i18nsupport/ngx-i18nsupport-lib" "^1.12.1"
chalk "^2.4.1"
he "^1.1.1"
request "^2.85.0"
tslib "^1.9.0"
"@ngx-i18nsupport/tooling@^8.0.3":
version "8.0.3"
resolved "https://registry.yarnpkg.com/@ngx-i18nsupport/tooling/-/tooling-8.0.3.tgz#be3454eaa06ad8518ddda7a6bfbc57b95dffbfce"
integrity sha512-AAsjwklil2HKEHLreAEAOHB71WDqHtYxWinP+B/YWQH8UlVyZwvXXQigrsaiQyKIKdTueKGQ8ThS24GRiE1R/g==
dependencies:
"@ngx-i18nsupport/ngx-i18nsupport" "^1.1.6"
tslib "^1.9.0"
"@ngx-loading-bar/core@^4.2.0":
version "4.2.0"
resolved "https://registry.yarnpkg.com/@ngx-loading-bar/core/-/core-4.2.0.tgz#cf0cc209eb967bd7625c2cec565841890cd5e17e"
@ -1147,6 +1176,11 @@
"@types/parse-torrent" "*"
"@types/simple-peer" "*"
"@types/xmldom@^0.1.29":
version "0.1.29"
resolved "https://registry.yarnpkg.com/@types/xmldom/-/xmldom-0.1.29.tgz#c4428b0ca86d3b881475726fd94980b38a27c381"
integrity sha1-xEKLDKhtO4gUdXJv2UmAs4onw4E=
"@videojs/http-streaming@1.10.6":
version "1.10.6"
resolved "https://registry.yarnpkg.com/@videojs/http-streaming/-/http-streaming-1.10.6.tgz#a9119b1828b354c5cc17b42ea051cc7bcce2dca0"
@ -4711,7 +4745,7 @@ hash.js@^1.0.0, hash.js@^1.0.3:
inherits "^2.0.3"
minimalistic-assert "^1.0.1"
he@1.2.x:
he@1.2.x, he@^1.1.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
@ -8325,7 +8359,7 @@ repeating@^2.0.0:
dependencies:
is-finite "^1.0.0"
request@^2.83.0, request@^2.87.0, request@^2.88.0:
request@^2.83.0, request@^2.85.0, request@^2.87.0, request@^2.88.0:
version "2.88.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==
@ -9709,6 +9743,11 @@ toidentifier@1.0.0:
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553"
integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==
tokenizr@^1.3.10:
version "1.5.5"
resolved "https://registry.yarnpkg.com/tokenizr/-/tokenizr-1.5.5.tgz#bdb68ce4e52f6afefb2ed1b18279e32be87ef649"
integrity sha512-cbiOvnZXf9JFUAgbxnsu8Uv0KDiPKevcYRcx/UirBqwgm4PJ6Vigi5ezjXeVTD0Tk6uGzwocGGjmkgPP8NLlAw==
toposort@^1.0.0:
version "1.0.7"
resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.7.tgz#2e68442d9f64ec720b8cc89e6443ac6caa950029"
@ -10657,6 +10696,11 @@ xmlbuilder@~11.0.0:
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3"
integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==
xmldom@^0.1.27:
version "0.1.27"
resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.27.tgz#d501f97b3bdb403af8ef9ecc20573187aadac0e9"
integrity sha1-1QH5ezvbQDr4757MIFcxh6rawOk=
xmlhttprequest-ssl@~1.5.4:
version "1.5.5"
resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e"

View file

@ -1,25 +1,21 @@
import { registerTSPaths } from '../../server/helpers/register-ts-paths'
registerTSPaths()
import * as jsToXliff12 from 'xliff/jsToXliff12'
import { writeFile } from 'fs-extra'
import { writeJSON } from 'fs-extra'
import { join } from 'path'
import {
buildLanguages,
VIDEO_CATEGORIES,
VIDEO_IMPORT_STATES,
VIDEO_LICENCES, VIDEO_PLAYLIST_PRIVACIES, VIDEO_PLAYLIST_TYPES,
VIDEO_LICENCES,
VIDEO_PLAYLIST_PRIVACIES,
VIDEO_PLAYLIST_TYPES,
VIDEO_PRIVACIES,
VIDEO_STATES
} from '../../server/initializers/constants'
import { values } from 'lodash'
type TranslationType = {
target: string
data: { [id: string]: string }
}
registerTSPaths()
const videojs = require(join(__dirname, '../../../client/src/locale/source/videojs_en_US.json'))
const videojs = require(join(__dirname, '../../../client/src/locale/videojs.en-US.json'))
const playerKeys = {
'Quality': 'Quality',
'Auto': 'Auto',
@ -37,10 +33,7 @@ const playerKeys = {
'Total downloaded: ': 'Total downloaded: ',
'Total uploaded: ': 'Total uploaded: '
}
const playerTranslations = {
target: join(__dirname, '../../../client/src/locale/source/player_en_US.xml'),
data: Object.assign({}, videojs, playerKeys)
}
Object.assign(playerKeys, videojs)
// Server keys
const serverKeys: any = {}
@ -65,57 +58,17 @@ Object.assign(serverKeys, {
'Unknown': 'Unknown'
})
const serverTranslations = {
target: join(__dirname, '../../../client/src/locale/source/server_en_US.xml'),
data: serverKeys
}
// ISO 639 keys
const languageKeys: any = {}
const languages = buildLanguages()
Object.keys(languages).forEach(k => languageKeys[languages[k]] = languages[k])
const iso639Translations = {
target: join(__dirname, '../../../client/src/locale/source/iso639_en_US.xml'),
data: languageKeys
}
Object.assign(serverKeys, languageKeys)
saveToXliffFile(playerTranslations, err => {
if (err) return handleError(err)
saveToXliffFile(serverTranslations, err => {
if (err) return handleError(err)
saveToXliffFile(iso639Translations, err => {
if (err) return handleError(err)
process.exit(0)
})
})
})
// Then, the server strings
function saveToXliffFile (jsonTranslations: TranslationType, cb: Function) {
const obj = {
resources: {
namespace1: {}
}
}
Object.keys(jsonTranslations.data).forEach(k => obj.resources.namespace1[ k ] = { source: jsonTranslations.data[ k ] })
jsToXliff12(obj, (err, res) => {
if (err) return cb(err)
writeFile(jsonTranslations.target, res, err => {
if (err) return cb(err)
return cb(null)
})
})
}
function handleError (err: any) {
Promise.all([
writeJSON(join(__dirname, '../../../client/src/locale/player.en-US.json'), playerKeys),
writeJSON(join(__dirname, '../../../client/src/locale/server.en-US.json'), serverKeys)
]).catch(err => {
console.error(err)
process.exit(-1)
}
})

View file

@ -3,12 +3,11 @@
set -eu
cd client
npm run ng -- xi18n --i18n-locale "en-US" --output-path src/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
npm run ng -- xi18n --i18n-locale "en-US" --output-path src/locale --out-file angular.xlf
npm run ngx-extractor -- --locale "en-US" -i 'src/**/*.ts' -f xlf -o src/locale/angular.xlf
# 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)
perl -pi -e 's|<x id=(.+?)/>|&lt;x id=\1/&gt;|g' src/locale/source/angular_en_US.xml
# Merge new translations in other language files
npm run ng run -- PeerTube:xliffmerge
# Add our strings too
cd ../

View file

@ -2,14 +2,5 @@
set -eu
for i in $(seq 1 10); do
# Angular does not like when there is not target element, so we create it with the same content than the source element
perl -0pi -e 's#<source>([^<]+)</source>\s*<context-group #<source>\1</source><target>\1</target><context-group #g' client/src/locale/target/angular_*.xml
# Zanata does not support inner elements in <source>, so we hack these special elements
# This regex translate the converted elements to initial Angular elements
perl -pi -e 's|&lt;x id=(.+?)/&gt;([^"])|<x id=\1/>\2|g' client/src/locale/target/*.xml
done
npm run i18n:xliff2json