1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-27 02:43:45 +02:00

Modified language json structure to not include the code.

Also removed languages from being combined with core until we add the ability to choose languages.
This commit is contained in:
Steve Heffernan 2014-08-05 17:33:21 -07:00
parent 6b612d8cdc
commit 7ea1d8f544
3 changed files with 34 additions and 38 deletions

View File

@ -428,21 +428,19 @@ module.exports = function(grunt) {
gzip = require('zlib').gzip; gzip = require('zlib').gzip;
grunt.registerMultiTask('lang', 'Building Language Support', function() { grunt.registerMultiTask('lang', 'Building Language Support', function() {
var combined = '';
grunt.log.writeln('Building Language Support'); grunt.log.writeln('Building Language Support');
var langFiles = this.files;
var combined;
// Create a combined languages file // Create a combined languages file
langFiles.forEach(function(result) { this.files.forEach(function(file) {
combined += grunt.file.read(result.src); file.src.forEach(function(src){
var code = src.replace('lang/', '').replace('.json', '');
combined += 'videojs.options[\'languages\'][\''+code+'\'] = '+ grunt.file.read(src).trim() + ';\n';
});
}); });
combined = combined.replace('undefined', 'vjs.options["languages"] = ');
grunt.file.write('build/files/combined.languages.js', combined); grunt.file.write('build/files/combined.languages.js', combined);
}); });
grunt.registerMultiTask('build', 'Building Source', function(){ grunt.registerMultiTask('build', 'Building Source', function(){
@ -462,7 +460,7 @@ module.exports = function(grunt) {
combined = combined.replace(/GENERATED_CDN_VSN/g, version.majorMinor); combined = combined.replace(/GENERATED_CDN_VSN/g, version.majorMinor);
// Add Combined Langauges // Add Combined Langauges
combined += grunt.file.read('build/files/combined.languages.js'); // combined += grunt.file.read('build/files/combined.languages.js');
grunt.file.write('build/files/combined.video.js', combined); grunt.file.write('build/files/combined.video.js', combined);

View File

@ -1,28 +1,26 @@
{'es': {
{ "Play": "Juego",
'Play': 'Juego', "Pause": "Pausa",
'Pause': 'Pausa', "Current Time": "Tiempo Actual",
'Current Time': 'Tiempo Actual', "Duration Time": "Tiempo de Duracion",
'Duration Time': 'Tiempo de Duracion', "Remaining Time": "Tiempo Restante",
'Remaining Time': 'Tiempo Restante', "Stream Type": "Tipo de Transmision",
'Stream Type': 'Tipo de Transmision', "LIVE": "En Vivo",
'LIVE': 'En Vivo', "Loaded": "Cargado",
'Loaded': 'Cargado', "Progress": "Progreso",
'Progress': 'Progreso', "Fullscreen": "Pantalla Completa",
'Fullscreen': 'Pantalla Completa', "Non-Fullscreen": "No Pantalla Completa",
'Non-Fullscreen': 'No Pantalla Completa', "Mute": "Mudo",
'Mute': 'Mudo', "Unmuted": "Activar sonido",
'Unmuted': 'Activar sonido', "Playback Rate": "Reproduccion Cambio",
'Playback Rate': 'Reproduccion Cambio', "Subtitles": "Subtitulos",
'Subtitles': 'Subtitulos', "subtitles off": "subtitulos fuera",
'subtitles off': 'subtitulos fuera', "Captions": "Subtitulos",
'Captions': 'Subtitulos', "captions off": "subtitulos fuera",
'captions off': 'subtitulos fuera', "Chapters": "Capitulos",
'Chapters': 'Capitulos', "You aborted the video playback": "Ha anulado la reproduccion de video",
'You aborted the video playback': 'Ha anulado la reproduccion de video', "A network error caused the video download to fail part-way.": "Un error en la red hizo que la descarga de video falle parte del camino.",
'A network error caused the video download to fail part-way.': 'Un error en la red hizo que la descarga de video falle parte del camino.', "The video could not be loaded, either because the server or network failed or because the format is not supported.": "El video no se puede cargar, ya sea porque el servidor o la red fracasaron o porque el formato no es compatible.",
'The video could not be loaded, either because the server or network failed or because the format is not supported.': 'El video no se puede cargar, ya sea porque el servidor o la red fracasaron o porque el formato no es compatible.', "The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "La reproduccion de video se ha cancelado debido a un problema de corrupcion o porque el video utilizado cuenta con su navegador no soporta.",
'The video playback was aborted due to a corruption problem or because the video used features your browser did not support.': 'La reproduccion de video se ha cancelado debido a un problema de corrupcion o porque el video utilizado cuenta con su navegador no soporta.', "No compatible source was found for this video.": "Ninguna fuente compatible se encontro para este video."
'No compatible source was found for this video.': 'Ninguna fuente compatible se encontro para este video.' }
}
}

View File

@ -18,5 +18,5 @@ test('should localize its text', function(){
testButton.buttonText = 'Play'; testButton.buttonText = 'Play';
el = testButton.createEl(); el = testButton.createEl();
ok(el.textContent, 'Juego', 'translation was successful'); ok(el.innerHTML, 'Juego', 'translation was successful');
}); });