diff --git a/src/cloud/occi/etc/occi-server.conf b/src/cloud/occi/etc/occi-server.conf index f40470112e..ca272a763d 100644 --- a/src/cloud/occi/etc/occi-server.conf +++ b/src/cloud/occi/etc/occi-server.conf @@ -51,3 +51,6 @@ :template: large.erb :cpu: 8 :memory: 8192 + +# Default language setting for Self-Service UI +:lang: en_US diff --git a/src/cloud/occi/lib/occi-server.rb b/src/cloud/occi/lib/occi-server.rb index 85df192ca9..1710cf16f3 100755 --- a/src/cloud/occi/lib/occi-server.rb +++ b/src/cloud/occi/lib/occi-server.rb @@ -50,6 +50,7 @@ require 'sinatra' require 'yaml' require 'erb' require 'tempfile' +require 'json' require 'OCCIServer' require 'CloudAuth' @@ -166,16 +167,16 @@ helpers do session[:user] = username session[:remember] = params[:remember] - if user['TEMPLATE/LANG'] - session[:lang] = user['TEMPLATE/LANG'] - else - session[:lang] = settings.config[:lang] - end - if params[:remember] env['rack.session.options'][:expire_after] = 30*60*60*24 end + if params[:lang] + session[:lang] = params[:lang] + else + session[:lang] = settings.config[:lang] + end + return [204, ""] end end @@ -311,6 +312,20 @@ end ## UI ############################################## +post '/config' do + begin + body = JSON.parse(request.body.read) + rescue + [500, "POST Config: Error parsing configuration JSON"] + end + + body.each do | key,value | + case key + when "lang" then session[:lang]=value + end + end +end + get '/ui/login' do File.read(File.dirname(__FILE__)+'/ui/templates/login.html') end diff --git a/src/cloud/occi/lib/ui/public/customize/custom.js b/src/cloud/occi/lib/ui/public/customize/custom.js index d98ee3c6e0..e26e24fecc 100644 --- a/src/cloud/occi/lib/ui/public/customize/custom.js +++ b/src/cloud/occi/lib/ui/public/customize/custom.js @@ -78,24 +78,28 @@ var network_box_html = '

'+tr("Your compute resources connectivity is performe //Compute tab /////////////////////////////////////////////////////////// var compute_dashboard_image = "images/one-compute.png"; -var compute_dashboard_html = '

' + tr("This is a list of your current compute resources. Virtual Machines use previously defined images and networks. You can easily create a new compute element by cliking \"new\" and filling-in an easy wizard.")+'

\ +var compute_dashboard_html = '

' + tr("This is a list of your current compute resources. Virtual Machines use previously defined images and networks. You can easily create a new compute element by cliking \'new\' and filling-in an easy wizard.")+'

\

'+tr("You can also manage compute resources and perform actions such as stop, resume, shutdown or cancel.")+'

\ -

'+tr("Additionally, you can take a \"snapshot\" of the storage attached to these resources. They will be saved as new resources, visible from the Storage view and re-usable.")+'

\ -

'+tr("There are currently")+' '+$vm_count+' '+tr("virtual machines")+'.

'; +

'+tr("Additionally, you can take a \'snapshot\' of the storage attached to these resources. They will be saved as new resources, visible from the Storage view and re-usable.")+'

\ +

'+tr("There are currently")+' '+$vm_count+' '+ + tr("virtual machines")+'.

'; /////////////////////////////////////////////////////////// //Storage tab /////////////////////////////////////////////////////////// var storage_dashboard_image = "images/one-storage.png"; var storage_dashboard_html = '

'+tr("The Storage view offers you an overview of your current images. Storage elements are attached to compute resources at creation time. They can also be extracted from running virtual machines by taking an snapshot.")+'

\ -

'+tr("You can add new storages by clicking \"new\". Image files will be uploaded to OpenNebula and set ready to be used.")+'

\ +

'+tr("You can add new storages by clicking \'new\'. Image files will be uploaded to OpenNebula and set ready to be used.")+'

\

'+tr("Additionally, you can run several operations on defined storages, such as defining their persistance. Persistent images can only be used by 1 virtual machine, and the changes made by it have effect on the base image. Non-persistent images are cloned before being used in a Virtual Machine, therefore changes are lost unless a snapshot is taken prior to Virtual Machine shutdown.")+'

\ -

'+tr("There are currently")+' '+$storage_count+' '+tr("images")+'.

'; +

'+tr("There are currently")+' '+$storage_count+' '+ + tr("images")+'.

'; /////////////////////////////////////////////////////////// //Network tab /////////////////////////////////////////////////////////// var network_dashboard_image = "image/one-network.png"; -var network_dashboard_html = '

'+tr("In this view you can easily manage OpenNebula Network resources. You can add, remove, publish or unpublish virtual networks.")+'

\ +var network_dashboard_html = '

'+tr("In this view you can easily manage OpenNebula Network resources. You can add or remove virtual networks.")+'

\

'+tr("Compute resources can be attached to these networks at creation time. Virtual machines will be provided with an IP and the correct parameters to ensure connectivity.")+'

\ -

'+tr("There are currently")+' '+$network_count+' '+tr("networks")+'.

'; \ No newline at end of file +

'+ + tr("There are currently")+' '+$network_count+' '+ + tr("networks")+'.

'; \ No newline at end of file diff --git a/src/cloud/occi/lib/ui/public/js/locale.js b/src/cloud/occi/lib/ui/public/js/locale.js index 28628c96de..bfec7d8f4e 100644 --- a/src/cloud/occi/lib/ui/public/js/locale.js +++ b/src/cloud/occi/lib/ui/public/js/locale.js @@ -30,8 +30,7 @@ function tr(str){ //Pops up loading new language dialog. Retrieves the user template, updates the LANG variable. //Updates template and session configuration and reloads the view. function setLang(lang_str){ - var lang_tmp=""; - var dialog = $('
Loading new language... please wait '+spinner+'
').dialog({ + var dialog = $('
'+tr("Loading new language... please wait")+' '+spinner+'
').dialog({ draggable:false, modal:true, resizable:false, @@ -40,51 +39,14 @@ function setLang(lang_str){ minHeight: 50 }); - - var updateUserTemplate = function(request,user_json){ - var template = user_json.USER.TEMPLATE; - var template_str=""; - template["LANG"] = lang_tmp; - - //convert json to ONE template format - simple conversion - $.each(template,function(key,value){ - template_str += (key + '=' + '"' + value + '"\n'); - }); - - var obj = { - data: { - id: uid, - extra_param: template_str - }, - error: onError - }; - OpenNebula.User.update(obj); - $.post('config',JSON.stringify({lang:lang_tmp}),function(){window.location.href = "."}); - - }; - - lang_tmp = lang_str; - - if (whichUI() == "sunstone"){ - var obj = { - data : { - id: uid, - }, - success: updateUserTemplate - }; - OpenNebula.User.show(obj); - } else { - dialog.dialog('close'); + + if (('localStorage' in window) && (window['localStorage'] !== null)){ + localStorage['lang']=lang_str; }; + $.post('config',JSON.stringify({lang:lang_str}),function(){window.location.href = "./ui"}); }; $(document).ready(function(){ - if (lang) - $('#lang_sel option[value="'+lang+'"]').attr('selected','selected'); - $('#lang_sel').change(function(){ - setLang($(this).val()); - }); - //Update static translations $('#doc_link').text(tr("Documentation")); $('#support_link').text(tr("Support")); diff --git a/src/cloud/occi/lib/ui/public/js/login.js b/src/cloud/occi/lib/ui/public/js/login.js index e760c781ac..13eff1f619 100644 --- a/src/cloud/occi/lib/ui/public/js/login.js +++ b/src/cloud/occi/lib/ui/public/js/login.js @@ -37,16 +37,21 @@ function auth_error(req, error){ function authenticate(){ var username = $("#username").val(); var password = $("#password").val(); + password = Crypto.SHA1(password); var remember = $("#check_remember").is(":checked"); - password = Crypto.SHA1(password); + var obj = { data: {username: username, + password: password}, + remember: remember, + success: auth_success, + error: auth_error + }; - OCCI.Auth.login({ data: {username: username - , password: password} - , remember: remember - , success: auth_success - , error: auth_error - }); + if (('localStorage' in window) && (window['localStorage'] !== null) && (localStorage['lang'])){ + obj['lang'] = localStorage['lang']; + }; + + OCCI.Auth.login(obj); } $(document).ready(function(){ diff --git a/src/cloud/occi/lib/ui/public/js/occi.js b/src/cloud/occi/lib/ui/public/js/occi.js index fba3b39144..45cda58f7c 100644 --- a/src/cloud/occi/lib/ui/public/js/occi.js +++ b/src/cloud/occi/lib/ui/public/js/occi.js @@ -359,6 +359,7 @@ var OCCI = { var username = params.data.username; var password = params.data.password; var remember = params.remember; + var lang = params.lang; var resource = OCCI.Auth.resource; var request = OCCI.Helper.request(resource,"login"); @@ -366,7 +367,7 @@ var OCCI = { $.ajax({ url: "ui/login", type: "POST", - data: {remember: remember}, + data: {remember: remember, lang: lang}, beforeSend : function(req) { req.setRequestHeader( "Authorization", "Basic " + btoa(username + ":" + password) diff --git a/src/cloud/occi/lib/ui/public/js/plugins/compute.js b/src/cloud/occi/lib/ui/public/js/plugins/compute.js index 6b4ceef514..ac6fd96681 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/compute.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/compute.js @@ -308,7 +308,7 @@ var vm_buttons = { "VM.shutdown" : { type: "confirm", text: tr("Shutdown"), - tip: tr("This will initiate the shutdown process in the selected VMs") + tip: tr("This will shutdown the selected VMs") }, "action_list" : { @@ -317,12 +317,12 @@ var vm_buttons = { "VM.suspend" : { type: "confirm", text: tr("Suspend"), - tip: tr("This will suspend selected machines") + tip: tr("This will suspend the selected VMs") }, "VM.resume" : { type: "confirm", text: tr("Resume"), - tip: tr("This will resume selected stopped or suspended VMs") + tip: tr("This will resume the selected VMs in stopped or suspended states") }, "VM.stop" : { type: "confirm", @@ -336,7 +336,7 @@ var vm_buttons = { }, "VM.saveasmultiple" : { type: "action", - text: tr("Save as") + text: tr("Take snapshot") } } }, @@ -744,7 +744,7 @@ function popUpCreateVMDialog(){ //Prepares a dialog to saveas a VM function setupSaveasDialog(){ //Append to DOM - dialogs_context.append('
'); + dialogs_context.append('
'); $saveas_vm_dialog = $('#saveas_vm_dialog',dialogs_context); var dialog = $saveas_vm_dialog; diff --git a/src/cloud/occi/lib/ui/public/js/plugins/configuration.js b/src/cloud/occi/lib/ui/public/js/plugins/configuration.js new file mode 100644 index 0000000000..97c5803b1c --- /dev/null +++ b/src/cloud/occi/lib/ui/public/js/plugins/configuration.js @@ -0,0 +1,62 @@ +/* -------------------------------------------------------------------------- */ +/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ +/* not use this file except in compliance with the License. You may obtain */ +/* a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ +/* See the License for the specific language governing permissions and */ +/* limitations under the License. */ +/* -------------------------------------------------------------------------- */ + +var config_tab_content = +'
\ +\ + \ + \ + \ +
\ +
\ +

' + tr("Self-Service UI Configuration") + '

\ +
\ +\ + \ + \ + \ + \ + \ +
' + tr("Language") + '\ + \ +
\ +\ +
\ +
\ +
'; + +var config_tab = { + title: tr("Configuration"), + content: config_tab_content +} + +Sunstone.addMainTab('config_tab',config_tab); + +$(document).ready(function(){ + if (lang) + $('table#config_table #lang_sel option[value="'+lang+'"]').attr('selected','selected'); + $('table#config_table #lang_sel').change(function(){ + setLang($(this).val()); + }); + + $('#li_config_tab a').click(function(){ + hideDialog(); + }); + +}); \ No newline at end of file diff --git a/src/cloud/occi/lib/ui/public/js/plugins/dashboard.js b/src/cloud/occi/lib/ui/public/js/plugins/dashboard.js index 024df21719..f73b25e709 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/dashboard.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/dashboard.js @@ -78,8 +78,8 @@ var dashboard_tab_content = '+ compute_box_html + - '

Create new compute resource
\ -See more

\ + '

'+tr("Create new compute resource")+'
\ +'+tr("See more")+'

\ \ \ \ @@ -92,8 +92,8 @@ var dashboard_tab_content = ' + storage_box_html + - '

Create new storage resource
\ -See more

\ + '

'+tr("Create new storage resource")+'
\ +'+tr("See more")+'

\ \ \ \ @@ -106,8 +106,8 @@ var dashboard_tab_content =

' + network_box_html + - '

Create new network resource
\ -See more

\ + '

'+tr("Create new network resource")+'
\ +'+tr("See more")+'

\ \ \ \ diff --git a/src/cloud/occi/lib/ui/public/js/plugins/storage.js b/src/cloud/occi/lib/ui/public/js/plugins/storage.js index 1fdd704fbe..131c824f24 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/storage.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/storage.js @@ -44,12 +44,12 @@ var create_image_tmpl =
\ \ \ -
'+tr("Name that the Image will get. Every image must have a unique name.")+'
\ +
'+tr("Name that the Image will get.")+'
\
\
\ \ \ -
'+tr("Human readable description of the image for other users.")+'
\ +
'+tr("Human readable description of the image.")+'
\
\ \
\ @@ -60,7 +60,7 @@ var create_image_tmpl = \ \ \ -
'+tr("Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).")+'
\ +
'+tr("Type of the image")+'
\ \
\ \ diff --git a/src/cloud/occi/lib/ui/public/locale/en_US/en_US.js b/src/cloud/occi/lib/ui/public/locale/en_US/en_US.js new file mode 100644 index 0000000000..1d13154a89 --- /dev/null +++ b/src/cloud/occi/lib/ui/public/locale/en_US/en_US.js @@ -0,0 +1,157 @@ +//Translated by +lang="en_US" +datatable_lang="" +locale={ + "Additionally, OpenNebula Self-Service allows easy customization of the interface (e.g. this text) and brings multi-language support.":"", + "Additionally, you can run several operations on defined storages, such as defining their persistance. Persistent images can only be used by 1 virtual machine, and the changes made by it have effect on the base image. Non-persistent images are cloned before being used in a Virtual Machine, therefore changes are lost unless a snapshot is taken prior to Virtual Machine shutdown.":"", + "Additionally, you can take a \'snapshot\' of the storage attached to these resources. They will be saved as new resources, visible from the Storage view and re-usable.":"", + "Add storage":"", + "All":"", + "are mandatory":"", + "Cancel":"", + "Cannot contact server: is it running and reachable?":"", + "Canvas not supported.":"", + "CD-ROM":"", + "Changing language":"", + "Community":"", + "Compute":"", + "Compute resource":"", + "Compute resources are Virtual Machines attached to storage and network resources. OpenNebula Self-Service allows you to easily create, remove and manage them, including the possibility of pausing a Virtual Machine or taking a snapshot of one of their disks.":"", + "Compute resources can be attached to these networks at creation time. Virtual machines will be provided with an IP and the correct parameters to ensure connectivity.":"", + "Configuration":"", + "Confirmation of action":"", + "CPU":"", + "Create network":"", + "Create new compute resource":"", + "Create new network resource":"", + "Create new storage resource":"", + "Create Virtual Machine":"", + "Create # VMs":"", + "Current resources":"", + "Dashboard":"", + "Datablock":"", + "Delete":"", + "Description":"", + "disk id":"", + "Disks":"", + "Disks information":"", + "Documentation":"", + "Do you want to proceed?":"", + "English":"", + "Error":"", + "Fields marked with":"", + "Filesystem type":"", + "FS type":"", + "Have a cloudy experience!":"", + "Human readable description of the image.":"", + "ID":"", + "Image":"", + "Image information":"", + "Image name":"", + "images":"", + "Images":"", + "Info":"", + "information":"", + "Instance type":"", + "In this view you can easily manage OpenNebula Network resources. You can add or remove virtual networks.":"", + "IP":"", + "Language":"", + "Loading":"", + "MAC":"", + "Make non persistent":"", + "Make persistent":"", + "Memory":"", + "Monitoring information":"", + "Name":"", + "Name that the Image will get.":"", + "Network":"", + "Network Address":"", + "Network information":"", + "Network is unreachable: is OpenNebula running?":"", + "Network reception":"", + "networks":"", + "Networks":"", + "Networks information":"", + "Network Size":"", + "Network transmission":"", + "+ New":"", + "No disk id or image name specified":"", + "No disks defined":"", + "No networks defined":"", + "OK":"", + "OpenNebula Self-Service is a simplified user interface to manage OpenNebula compute, storage and network resources. It is focused on easiness and usability and features a limited set of operations directed towards end-users.":"", + "Open VNC Session":"", + "OS":"", + "Persistence of the image":"", + "Persistent":"", + "Please, choose and modify the template you want to update":"", + "Please provide a network address":"", + "Please select":"", + "Previous action":"", + "Public":"", + "Public scope of the image":"", + "Publish":"", + "Refresh list":"", + "Resume":"", + "Retrieving":"", + "Saveas for VM with ID":"", + "See more":"", + "Select a template":"", + "Select disk":"", + "Self-Service UI Configuration":"", + "Shutdown":"", + "Sign out":"", + "Size":"", + "Size (Mb)":"", + "Size of the datablock in MB.":"", + "Skipping VM ":"", + "Spanish":"", + "State":"", + "Stop":"", + "Storage":"", + "Storage pool is formed by several images. These images can contain from full operating systems to be used as base for compute resources, to simple data. OpenNebula Self-Service offers you the possibility to create or upload your own images.":"", + "String":"", + "style":"", + "Submitted":"", + "Support":"", + "Suspend":"", + "Take snapshot":"", + "Target":"", + "There are currently":"", + "The Storage view offers you an overview of your current images. Storage elements are attached to compute resources at creation time. They can also be extracted from running virtual machines by taking an snapshot.":"", + "This is a list of your current compute resources. Virtual Machines use previously defined images and networks. You can easily create a new compute element by cliking \'new\' and filling-in an easy wizard.":"", + "This will cancel selected VMs":"", + "This will delete the selected VMs from the database":"", + "This will resume the selected VMs in stopped or suspended states":"", + "This will shutdown the selected VMs":"", + "This will suspend the selected VMs":"", + "Type":"", + "Type of file system to be built. This can be any value understood by mkfs unix command.":"", + "Type of the image":"", + "Unauthorized":"", + "Unpublish":"", + "Update":"", + "Update template":"", + "Upload image":"", + "Upload progress":"", + "Useful links":"", + "Virtual Machine information":"", + "virtual machines":"", + "Virtual Network":"", + "Virtual Network information":"", + "Virtual Network name missing!":"", + "VM information":"", + "VM Name":"", + "VNC connection":"", + "VNC Disabled":"", + "Welcome":"", + "Welcome to OpenNebula Self-Service":"", + "You can add new storages by clicking \'new\'. Image files will be uploaded to OpenNebula and set ready to be used.":"", + "You can also manage compute resources and perform actions such as stop, resume, shutdown or cancel.":"", + "You have to confirm this action.":"", + "You must select a file to upload":"", + "You must specify a name":"", + "You must specify size and FS type":"", + "You need to select something.":"", + "Your compute resources connectivity is performed using pre-defined virtual networks. You can create and manage these networks using OpenNebula Self-Service.":"", +}; diff --git a/src/cloud/occi/lib/ui/public/locale/es_ES/es_ES.js b/src/cloud/occi/lib/ui/public/locale/es_ES/es_ES.js new file mode 100644 index 0000000000..96d30e7769 --- /dev/null +++ b/src/cloud/occi/lib/ui/public/locale/es_ES/es_ES.js @@ -0,0 +1,157 @@ +//Translated by +lang="es_ES" +datatable_lang="es_datatable.txt" +locale={ + "Additionally, OpenNebula Self-Service allows easy customization of the interface (e.g. this text) and brings multi-language support.":"Además, OpenNebula Self-Service permite una fácil personalización de la interfaz (por ejemplo, de este mismo texto) y viene con soporte para múltiples lenguajes.", + "Additionally, you can run several operations on defined storages, such as defining their persistance. Persistent images can only be used by 1 virtual machine, and the changes made by it have effect on the base image. Non-persistent images are cloned before being used in a Virtual Machine, therefore changes are lost unless a snapshot is taken prior to Virtual Machine shutdown.":"Además, puede ejecutar varias operaciones en los almacenamientos presentes, como definir su persistencia. Las imágenes persistentes sólo pueden ser usadas por 1 máquina virtual, y los cambios realizados por ella tiene efecto en la imágen base. Las imágenes no persistentes son clonadas antes de ser utilizadas en una máquina virtual, por tanto los cambios se pierden a menos que se tome una instantánea antes de apagar la máquina virtual.", + "Additionally, you can take a 'snapshot' of the storage attached to these resources. They will be saved as new resources, visible from the Storage view and re-usable.":"Además, puede tomar una 'instantánea' de los almacenamientos asociado a estos recursos. Ésta será salvaguardada como un nuevo recurso, visible y reutilizable desde la vista de almacenamientos.", + "Add storage":"Añadir almacenamiento", + "All":"Todos", + "are mandatory":"son obligatorios", + "Cancel":"Cancelar", + "Cannot contact server: is it running and reachable?":"No se puede contactar con el servidor: ¿está funcionando y es alcanzable?", + "Canvas not supported.":"Canvas no soportado", + "CD-ROM":"CD-ROM", + "Changing language":"Cambiando el lenguaje", + "Community":"Comunidad", + "Compute":"Máquinas Virtuales", + "Compute resource":"máquina virtual", + "Compute resources are Virtual Machines attached to storage and network resources. OpenNebula Self-Service allows you to easily create, remove and manage them, including the possibility of pausing a Virtual Machine or taking a snapshot of one of their disks.":"Las máquinas virtuales están asociadas a recursos de almacenamiento y de red. OpenNebula Self-Service le permite crearlos, borrarlos y administrarlos fácilmente, incluyendo la posibilidad de pausar una máquina virtual o de tomar una instantánea de alguno de sus discos.", + "Compute resources can be attached to these networks at creation time. Virtual machines will be provided with an IP and the correct parameters to ensure connectivity.":"Las máquinas virtuales pueden asociarse a estas redes en el momento de su creación. Las máquinas virtuales serán provistas de una IP y de los parámetros correctos para asegurar conectividad.", + "Configuration":"Configuración", + "Confirmation of action":"Confirmar operación", + "CPU":"CPU", + "Create network":"Crear red", + "Create new compute resource":"Crear nueva máquina virtual", + "Create new network resource":"Crear nueva red", + "Create new storage resource":"Crear nuevo almacenamiento", + "Create Virtual Machine":"Crear máquina virtual", + "Create # VMs":"Crear # MVs", + "Current resources":"Recursos actuales", + "Dashboard":"Portada", + "Datablock":"Datablock", + "Delete":"Borrar", + "Description":"Descripción", + "disk id":"id del disco", + "Disks":"Discos", + "Disks information":"Información de discos", + "Documentation":"Documentación", + "Do you want to proceed?":"¿Desea continuar?", + "English":"Inglés", + "Error":"Error", + "Fields marked with":"Campos marcados con", + "Filesystem type":"Sistema de ficheros", + "FS type":"tipo de FS", + "Have a cloudy experience!":"¡Nos vemos en las nubes!", + "Human readable description of the image.":"Descripción de la imagen.", + "ID":"ID", + "Image":"Imagen", + "Image information":"Información de la imagen", + "Image name":"Nombre de la imagen", + "images":"imágenes", + "Images":"Imágenes", + "Info":"Información", + "information":"Información", + "Instance type":"Tipo de instancia", + "In this view you can easily manage OpenNebula Network resources. You can add or remove virtual networks.":"En esta vista puede gestionar fácilmente los recursos de red de OpenNebula. Puede añadir o borrar redes virtuales.", + "IP":"IP", + "Language":"Lenguaje", + "Loading":"Cargando", + "MAC":"MAC", + "Make non persistent":"Hacer no persistente", + "Make persistent":"Hacer persistente", + "Memory":"Memoria", + "Monitoring information":"Información de monitorización", + "Name":"Nombre", + "Name that the Image will get.":"Nombre para la imagen.", + "Network":"Red", + "Network Address":"Dirección de red", + "Network information":"Información de red", + "Network is unreachable: is OpenNebula running?":"No se puede alcanzar la red: ¿está OpenNebula funcionando?", + "Network reception":"Recepción de red", + "networks":"redes", + "Networks":"Redes", + "Networks information":"Información de redes", + "Network Size":"Tamaño de red", + "Network transmission":"Transmisión de red", + "+ New":"+ Nuevo", + "No disk id or image name specified":"No se ha especificado ID de disco o nombre de la imagen", + "No disks defined":"No hay discos definidos", + "No networks defined":"No hay redes definidas", + "OK":"OK", + "OpenNebula Self-Service is a simplified user interface to manage OpenNebula compute, storage and network resources. It is focused on easiness and usability and features a limited set of operations directed towards end-users.":"OpenNebula Self-Service es una interfaz de usuario simplificada para administrar máquinas virtuales, almacenamiento y red de OpenNebula. Está basada en la facilidad de uso y cuenta con un número limitado de operaciones dirigidas a los usuarios finales.", + "Open VNC Session":"Abrir sesión VNC", + "OS":"OS", + "Persistence of the image":"Persistencia de la imagen", + "Persistent":"Persistente", + "Please, choose and modify the template you want to update":"Por favor, escoja y modifique la plantilla que desea actualizar", + "Please provide a network address":"Por favor, proporcione una dirección de red", + "Please select":"Por favor escoja", + "Previous action":"Acción anterior", + "Public":"Público", + "Public scope of the image":"", + "Publish":"Publicar", + "Refresh list":"Refrescar lista", + "Resume":"Reanudar", + "Retrieving":"Cargando", + "Saveas for VM with ID":"Instantánea a MV con ID", + "See more":"Ver más", + "Select a template":"Seleccione una plantilla", + "Select disk":"Seleccione un disco", + "Self-Service UI Configuration":"Configuración de la interfaz Self-Service", + "Shutdown":"Apagar", + "Sign out":"Desconectar", + "Size":"Tamaño", + "Size (Mb)":"Tamaño (Mb)", + "Size of the datablock in MB.":"Tamaño del datablcok en MB", + "Skipping VM ":"Saltando MV", + "Spanish":"Español", + "State":"Estado", + "Stop":"Detener", + "Storage":"Almacenamiento", + "Storage pool is formed by several images. These images can contain from full operating systems to be used as base for compute resources, to simple data. OpenNebula Self-Service offers you the possibility to create or upload your own images.":"La lista de almacenamiento está formada por varias imágenes. Estas imágenes pueden contener desde sistemas operativos completos para ser usados como base en máquinas virtuales, hasta simples datos. OpenNebula Self-Service ofrece la posibilidad de crear o subir sus propias imágenes.", + "String":"String", + "style":"estilo", + "Submitted":"Hecho", + "Support":"Soporte", + "Suspend":"Suspender", + "Take snapshot":"Tomar instantánea", + "Target":"Target", + "There are currently":"Actualmente hay", + "The Storage view offers you an overview of your current images. Storage elements are attached to compute resources at creation time. They can also be extracted from running virtual machines by taking an snapshot.":"La vista de almacenamiento le ofrece la visión general de sus imágenes. Los elementos de almacenamiento se asocian a máquinas virtuales en el momento de la creación. También pueden ser extraídos de una máquina virtual en ejecución tomando una instantánea", + "This is a list of your current compute resources. Virtual Machines use previously defined images and networks. You can easily create a new compute element by cliking 'new' and filling-in an easy wizard.":"Esta es una lista de sus máquinas virtuales actuales. Las máquinas virtuales utilizan imagenes y redes definidas previamente. Puede crear fácilmente una nueva máquina virtual haciendo click en 'New' y rellenado un sencillo formulario.", + "This will cancel selected VMs":"Esto cancelará las MVs seleccionadas", + "This will delete the selected VMs from the database":"Esto borrará las MVs seleccionadas de la base de datos", + "This will resume the selected VMs in stopped or suspended states":"Esto reanudará las MVs seleccionadas paradas o suspendidas", + "This will shutdown the selected VMs":"Esto apagará las MVs seleccionadas", + "This will suspend the selected VMs":"Esto suspenderá las MVs seleccionadas", + "Type":"Tipo", + "Type of file system to be built. This can be any value understood by mkfs unix command.":"Tipo de sistema de archivos a generar. Es válido cualquier valor entendido por el comando mkfs", + "Type of the image":"Tipo de la imagen", + "Unauthorized":"No autorizado", + "Unpublish":"Despublicar", + "Update":"Actualizar", + "Update template":"Actualizar plantilla", + "Upload image":"Subir imagen", + "Upload progress":"Progreso se subida", + "Useful links":"Enlances útiles", + "Virtual Machine information":"Información de máquina virtual", + "virtual machines":"máquinas virtuales", + "Virtual Network":"Red virtual", + "Virtual Network information":"Información de red virtual", + "Virtual Network name missing!":"¡Falta el nombre de la red!", + "VM information":"Información de MV", + "VM Name":"Nombre", + "VNC connection":"Conexión VNC", + "VNC Disabled":"VNC Desabilitado", + "Welcome":"Bienvenid@", + "Welcome to OpenNebula Self-Service":"Bienvenid@ a OpenNebula Self-Service", + "You can add new storages by clicking 'new'. Image files will be uploaded to OpenNebula and set ready to be used.":"Puede añadir nuevos almacenamientos haciendo click en 'new'. Los ficheros de imagen pueden ser subidos a OpenNebula y preparados para ser usado.", + "You can also manage compute resources and perform actions such as stop, resume, shutdown or cancel.":"También puede administrar las máquinas virtuales y realizar acciones como detener, reanudar, apagar o cancelar.", + "You have to confirm this action.":"Necesita confirmar esta acción", + "You must select a file to upload":"Debe seleccionar un fichero para subir", + "You must specify a name":"Debe especificar un nombre", + "You must specify size and FS type":"Debe especificar un tamaño y un tipo de FS", + "You need to select something.":"Debe seleccionar algo", + "Your compute resources connectivity is performed using pre-defined virtual networks. You can create and manage these networks using OpenNebula Self-Service.":"La conectividad de sus máquinas virtuales se realiza usando redes virtuales pre-definidas. Puede crear y administrar estas redes usando OpenNebula Self-Service.", +}; diff --git a/src/cloud/occi/lib/ui/public/locale/es_ES/es_datatable.txt b/src/cloud/occi/lib/ui/public/locale/es_ES/es_datatable.txt new file mode 100644 index 0000000000..fb48fd561b --- /dev/null +++ b/src/cloud/occi/lib/ui/public/locale/es_ES/es_datatable.txt @@ -0,0 +1,17 @@ +{ + "sProcessing": "Procesando...", + "sLengthMenu": "Número de elementos", + "sZeroRecords": "No hay elementos", + "sInfo": "Mostrando del _START_ al _END_ de _TOTAL_", + "sInfoEmpty": "No hay elementos", + "sInfoFiltered": "(filtado de un total de _MAX_)", + "sInfoPostFix": "", + "sSearch": "Buscar:", + "sUrl": "", + "oPaginate": { + "sFirst": "Primero", + "sPrevious": "Anterior", + "sNext": "Siguiente", + "sLast": "Último" + } +} diff --git a/src/cloud/occi/lib/ui/public/locale/generate_translation_template.rb b/src/cloud/occi/lib/ui/public/locale/generate_translation_template.rb new file mode 100755 index 0000000000..e6adde7429 --- /dev/null +++ b/src/cloud/occi/lib/ui/public/locale/generate_translation_template.rb @@ -0,0 +1,31 @@ +#!/usr/bin/env ruby +# -*- coding: utf-8 -*- + +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); you may # +# not use this file except in compliance with the License. You may obtain # +# a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +#--------------------------------------------------------------------------- # + +tr_strings = `grep -h -o -R -e 'tr("[[:print:]]*")' ../js/* ../customize/* | cut -d'"' -f 2 | sort -u` + +puts "//Translated by" +puts 'lang="en_US"' +puts 'datatable_lang=""' +puts "locale={" + +tr_strings.each_line do | line | + puts " \"#{line.chomp}\":\"\"," +end + +puts "};" diff --git a/src/cloud/occi/lib/ui/public/locale/upgrade_translation.js b/src/cloud/occi/lib/ui/public/locale/upgrade_translation.js new file mode 100755 index 0000000000..11da65b55d --- /dev/null +++ b/src/cloud/occi/lib/ui/public/locale/upgrade_translation.js @@ -0,0 +1,52 @@ +#!/usr/bin/js +/* -------------------------------------------------------------------------- */ +/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ +/* not use this file except in compliance with the License. You may obtain */ +/* a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ +/* See the License for the specific language governing permissions and */ +/* limitations under the License. */ +/* -------------------------------------------------------------------------- */ + +if (!arguments[0] || !arguments[1]){ + print("Usage: upgrade_translation.js > "); + quit(); +}; + +var from = arguments[0]; +var to = arguments[1]; + +load(from); +var tr=""; +var locale_old= {}; +for (tr in locale){ + locale_old[tr] = locale[tr]; +}; + +var lang_old = lang; +var dt_lang_old = datatable_lang + +load(to); +for (tr in locale){ + if (locale_old[tr]){ + locale[tr] = locale_old[tr] + }; +}; + +print("//Translated by"); +print('lang="'+lang_old+'"'); +print('datatable_lang="'+dt_lang_old+'"'); +print("locale={"); + +for (tr in locale){ + print(' "'+tr+'":"'+locale[tr]+'",'); +}; + +print("};"); \ No newline at end of file diff --git a/src/cloud/occi/lib/ui/views/index.erb b/src/cloud/occi/lib/ui/views/index.erb index 031fa00d36..a1d9fb677b 100644 --- a/src/cloud/occi/lib/ui/views/index.erb +++ b/src/cloud/occi/lib/ui/views/index.erb @@ -42,6 +42,7 @@ + @@ -63,7 +64,7 @@
- Welcome  | Sign Out + Welcome  | Sign Out