Unverified Commit 6a68d167 authored by Andinus's avatar Andinus Committed by GitHub
Browse files

Remove hardcoded strings (#1602)

* Remove hardcoded strings

From https://github.com/UPC/ravada/issues/1546

    Some of the text strings in the frontend templates are hardcoded
    instead of being inside "l" code so they can be translated.

* Define newly added entries in English file

From https://github.com/UPC/ravada/pull/1602#issuecomment-937707661:

    Remember this,
    https://ravada.readthedocs.io/en/latest/devel-docs/translations.html#new-entries.
    All new english entries must be defined in the english file, en.po
    in order to be later translated from Weblate.

    May you to add new entries in en.po? Thanks in advance.

* Remove hardcoded strings, add to localisation file
parent 38ca4c99
......@@ -914,3 +914,122 @@ msgstr "Open ports"
msgid "up"
msgstr "up"
msgid "No members found"
msgstr "No members found"
msgid "No groups found"
msgstr "No groups found"
msgid "This machine has a CD-ROM"
msgstr "This machine has a CD-ROM"
msgid "Keep the CD for the clones"
msgstr "Keep the CD for the clones"
msgid "Accept"
msgstr "Accept"
msgid "Fail"
msgstr "Fail"
msgid "This Virtual Machine has no display hardware attached"
msgstr "This Virtual Machine has no display hardware attached"
msgid "NAT"
msgstr "NAT"
msgid "Bridge"
msgstr "Bridge"
msgid "No bridges found"
msgstr "No bridges found"
msgid "disk"
msgstr "disk"
msgid "cdrom"
msgstr "cdrom"
msgid "system"
msgstr "system"
msgid "temporary"
msgstr "temporary"
msgid "data"
msgstr "data"
msgid "Content will be cleaned on restore"
msgstr "Content will be cleaned on restore"
msgid "Content will be cleaned on restore and shutdown"
msgstr "Content will be cleaned on restore and shutdown"
msgid "Content will be kept on restore"
msgstr "Content will be kept on restore"
msgid "type"
msgstr "type"
msgid "All machines"
msgstr "All machines"
msgid "Users from this network can run all virtual machines"
msgstr "Users from this network can run all virtual machines"
msgid "No machines"
msgstr "No machines"
msgid "Users from this network can run no virtual machines"
msgstr "Users from this network can run no virtual machines"
msgid "Anonymous"
msgstr "Anonymous"
msgid "Warning: anonymous machines won't show up unless you enable allowed."
msgstr "Warning: anonymous machines won't show up unless you enable allowed."
msgid "Network name is required"
msgstr "Network name is required"
msgid "This name is duplicated"
msgstr "This name is duplicated"
msgid "host"
msgstr "host"
msgid "base storage"
msgstr "base storage"
msgid "clone storage"
msgstr "clone storage"
msgid "default storage"
msgstr "default storage"
msgid "This virtual machine has no backups to purge"
msgstr "This virtual machine has no backups to purge"
msgid "End"
msgstr "End"
msgid "Time"
msgstr "Time"
msgid "Virtual machines pre-started"
msgstr "Virtual machines pre-started"
msgid "Warning: this virtual machine will be prepared as a base. This may take long."
msgstr "Warning: this virtual machine will be prepared as a base. This may take long."
msgid "Assign this virtual machine to the pre-started pool"
msgstr "Assign this virtual machine to the pre-started pool"
msgid "Virtual machines in the pool."
msgstr "Virtual machines in the pool."
msgid "Pool"
msgstr "Pool"
msgid "Prepare this machine as a base to create clones from it."
msgstr "Prepare this machine as a base to create clones from it."
......@@ -31,12 +31,17 @@
>
</select>
<button ng-show="new_member && new_member.name"
ng-click="add_member(new_member.name)">Add</button>
ng-click="add_member(new_member.name)">
<%=l 'Add' %>
</button>
</div>
<div ng-show="!removed">
<div class="alert alert-danger" ng-show="error">{{error}}</div>
<div class="alert alert-warning" ng-show="!error && group_members.length==0">No members found</div>
<div class="alert alert-warning"
ng-show="!error && group_members.length==0">
<%=l 'No members found' %>
</div>
</div>
<table class="table table-striped" ng-show="group_members.length>0">
......
......@@ -52,7 +52,7 @@
</tbody>
</table>
<div ng-show="ldap_groups.length == 0">
No groups found
<%=l 'No groups found' %>
</div>
</div>
</div>
......
......@@ -194,12 +194,14 @@
</div>
<div class="modal-body" ng-show="can_prepare_base(machine)">
<div ng-show="machine.info.cdrom">
<p>This machine has a CD-ROM</p>
<ul>
<p>
<%=l 'This machine has a CD-ROM' %>
</p>
<ul>
<li ng-repeat="cdrom in machine.info.cdrom">{{cdrom}}</li>
</ul>
<input type="checkbox" ng-model="with_cd" name="with_cd"/>
<label for="with_cd"><%=l 'Keep the CD for the clones' %></label>
</ul>
<input type="checkbox" ng-model="with_cd" name="with_cd"/>
<label for="with_cd"><%=l 'Keep the CD for the clones' %></label>
</div>
<p><%=l 'Are you sure you want to prepare the base of' %> {{machine.name}}?</p>
</div>
......@@ -218,7 +220,7 @@
<input type="checkbox" checked ng-show="machine.is_public" ng-click="open_modal('mp_',machine)" title="<%=l 'Make private'%>" ng-cloak>
<input type="checkbox" ng-hide="!machine.is_base || machine.is_public" ng-click="open_modal('mp_',machine)" title="<%=l 'Make public' %>" ng-cloak>
<div class="modal fade" tabindex="-1" role="dialog" id="mp_{{machine.id}}">
<div class="modal-dialog" role="document">
<div class="modal-content">
......@@ -238,7 +240,7 @@
</div>
</td>
% if ($autostart) {
<td class="lgMachToggle">
<input type="checkbox" ng-hide="machine.has_clones || machine.is_base" ng-model="machine.autostart" ng-true-value="1" ng-false-value="0" ng-change="set_autostart(machine.id,machine.autostart)" title="{{ machine.autostart ? 'Disable' : 'Enable'}} autostart">
......
......@@ -188,7 +188,9 @@
save
</button>
<button ng-click="load_settings()"
ng-disabled="formSettings.$pristine">cancel</button>
ng-disabled="formSettings.$pristine">
<%=l 'cancel' %>
</button>
</div>
</div>
......
<div class="card alert-info" ng-show="domain_access.length">
<h4>Client headers
<span class="badge badge-success" ng-show="check_client_access">Accept</span>
<span class="badge badge-danger" ng-hide="check_client_access">Fail</span>
<span class="badge badge-success"
ng-show="check_client_access"><%=l 'Accept' %></span>
<span class="badge badge-danger"
ng-hide="check_client_access"><%=l 'Fail' %></span>
</h4>
<ul>
% for my $name (sort @{$headers->names}) {
......
<div ng-show="domain.hardware.display.length<1">
This Virtual Machine has no display hardware attached
<%=l 'This Virtual Machine has no display hardware attached' %>
</div>
<ul ng-show="domain_display.length>0" class="nav nav-tabs"
......
......@@ -11,7 +11,7 @@
<div class="page-header">
<div class="panel panel-default">
<div class="panel-heading">
<h2>Virtual Machine <%= $domain->name %></h2>
<h2><%=l 'Virtual Machine' %> <%= $domain->name %></h2>
</div>
<form action="<%= $uri %>" method="post">
<input type="submit" name="start" value="start" <%= $_start_disabled %>>
......@@ -24,7 +24,7 @@
<a href="/machine/screenshot/<%= $domain->id %>.html"><%=l Screenshot %></a>
</form>
<img src="/img/screenshots/<%= $domain->id %>.png" width=400>
</div>
</div>
</div>
......
......@@ -16,8 +16,8 @@
</select>
</li>
<li class="list-group-item list-group-item-primary">
<span ng-show="item.type == 'NAT'">nat</span>
<span ng-show="item.type == 'bridge'">bridge</span>
<span ng-show="item.type == 'NAT'"><%=l 'nat' %></span>
<span ng-show="item.type == 'bridge'"><%=l 'bridge' %></span>
</li>
<li class="list-group-item">
<select ng-model="item.network"
......@@ -33,7 +33,7 @@
>
</select>
<span ng-hide="item.type == 'NAT' || network_bridges[0]">
No bridges found
<%=l 'No bridges found' %>
</span>
</li>
</ul>
......
......@@ -6,8 +6,8 @@
</div>
<div class="col-lg-2">
<select name="device" ng-model="add_disk.device">
<option>disk</option>
<option>cdrom</option>
<option><%=l 'disk' %></option>
<option><%=l 'cdrom' %></option>
</select>
</div>
</div>
......@@ -17,15 +17,21 @@
</div>
<div class="col-lg-2">
<select name="type" ng-model="add_disk.type">
<option value='sys'>system</option>
<option value='swap'>tmp</option>
<option value='data'>data</option>
<option value='sys'><%=l 'system' %></option>
<option value='swap'><%=l 'temporary' %></option>
<option value='data'><%=l 'data' %></option>
</select>
</div>
<div class="col-lg-6">
<span ng-show="add_disk.type == 'sys'">Content will be cleaned on restore</span>
<span ng-show="add_disk.type == 'swap'">Content will be cleaned on restore and shutdown</span>
<span ng-show="add_disk.type == 'data'">Content will be kept on restore</span>
<span ng-show="add_disk.type == 'sys'">
<%=l 'Content will be cleaned on restore' %>
</span>
<span ng-show="add_disk.type == 'swap'">
<%=l 'Content will be cleaned on restore and shutdown' %>
</span>
<span ng-show="add_disk.type == 'data'">
<%=l 'Content will be kept on restore' %>
</span>
</div>
</div>
<div class="row" ng-show="add_disk.device == 'disk'">
......
......@@ -2,7 +2,7 @@
<h2><%=l 'Add new Display' %></h2>
<div class="row">
<div class="col-lg-2">
<label for="type">type</label>
<label for="type"><%=l 'type' %></label>
</div>
<div class="col-lg-2">
<select name="type" ng-model="add_display.driver"
......
......@@ -11,7 +11,9 @@
>
</select>
<button ng-show="new_group"
ng-click="add_group_member(<%= $user->id %>,'<%= $user->name %>',new_group)">Add</button>
ng-click="add_group_member(<%= $user->id %>,'<%= $user->name %>',new_group)">
<%=l 'Add' %>
</button>
</div>
{{error}}
......
......@@ -3,25 +3,29 @@
</div>
<div class="row">
<div class="col-md-3" align="right">All machines</div>
<div class="col-md-3" align="right"><%=l 'All machines' %></div>
<div class="col-md-1" align="left">
<input type="checkbox" name="address" ng-model="network.all_domains"
ng-true-value="1" ng-false-value="0"
ng-change="check_all_domains(); update_network()"
>
</div>
<div class="col-md-8">Users from this network can run all virtual machines</div>
<div class="col-md-8">
<%=l 'Users from this network can run all virtual machines' %>
</div>
</div>
<div class="row">
<div class="col-md-3" align="right">No machines</div>
<div class="col-md-3" align="right"><%=l 'No machines' %></div>
<div class="col-md-1" align="left">
<input type="checkbox" name="address" ng-model="network.no_domains"
ng-true-value="1" ng-false-value="0"
ng-change="check_no_domains(); update_network()"
>
</div>
<div class="col-md-8">Users from this network can run no virtual machines</div>
<div class="col-md-8">
<%=l 'Users from this network can run no virtual machines' %>
</div>
</div>
<hr/>
......@@ -29,11 +33,10 @@
<div ng-show="network.no_domains == 0">
<div class="row">
<div class="col-md-2">
Public
<%=l 'Public' %>
</div>
<div class="col-md-2">
Anonymous
<%=l 'Anonymous' %>
</div>
</div>
......@@ -60,7 +63,7 @@
<div ng-show="machine.anonymous == 1 && machine.allowed== 0"
class="alert alert-warning">
Warning: anonymous machines won't show up unless you enable allowed.
Warning: anonymous machines won't show up unless you enable allowed.
</div>
<div ng-show="machine.anonymous == 1 && machine.is_public == 0"
......
......@@ -6,8 +6,12 @@
<input type="text" name="name" ng-model="network.name" required
ng-change='check_duplicate("name")'
>
<span ng-show="formNetwork.name.$error.required">Network name is required</span>
<span ng-show="network._duplicated_name">This name is duplicated</span>
<span ng-show="formNetwork.name.$error.required">
<%=l 'Network name is required' %>
</span>
<span ng-show="network._duplicated_name">
<%=l 'This name is duplicated' %>
</span>
</div>
</div>
......@@ -34,7 +38,9 @@
</div>
<div class="row">
<div class="col-md-3" align="right">All machines</div>
<div class="col-md-3" align="right">
<%=l 'All machines' %>
</div>
<div class="col-md-1" align="left">
<input type="checkbox" name="address" ng-model="network.all_domains"
ng-true-value="1" ng-false-value="0"
......
<div ng-show="network && network.id">
Are you sure you want to remove the <%= $item %> {{network.name}}
<button ng-click="remove_network(network.id)">yes</button>
<button onclick="location='/admin/networks'">cancel</button>
<button ng-click="remove_network(network.id)"><%=l 'yes' %></button>
<button onclick="location='/admin/networks'"><%=l 'cancel' %></button>
</div>
<div ng-show="message">{{message}}</div>
<div class="container-fluid">
<form name="formNode">
<div class="row">
<div class="col-md-3" align="right">name</div>
<div class="col-md-3" align="right"><%=l 'name' %></div>
<div class="col-md-8">
<input type="text" ng-model="node.name">
</div>
</div>
<div class="row">
<div class="col-md-3" align="right">host</div>
<div class="col-md-3" align="right"><%=l 'host' %></div>
<div class="col-md-8" align="left">
<input type="text" ng-model="node.hostname">
</div>
</div>
<div class="row">
<div class="col-md-3" align="right">base storage</div>
<div class="col-md-3" align="right"><%=l 'base storage' %></div>
<div class="col-md-8">
<input type="text" ng-model="node.base_storage" ng-hide="storage_pools"
/>
......@@ -27,7 +27,7 @@
</div>
<div class="row">
<div class="col-md-3" align="right">clone storage</div>
<div class="col-md-3" align="right"><%=l 'clone storage' %></div>
<div class="col-md-8">
<input type="text" ng-model="node.clone_storage" ng-hide="storage_pools"
/>
......@@ -39,7 +39,7 @@
</div>
<div class="row">
<div class="col-md-3" align="right">default storage</div>
<div class="col-md-3" align="right"><%=l 'default storage' %></div>
<div class="col-md-8">
<input type="text" ng-model="node.default_storage" ng-hide="storage_pools"
/>
......@@ -53,7 +53,7 @@
<div class="col-md-3" align="right"></div>
<div class="col-md-4" align="left">
<button ng-show="node.id" class="btn btn-outline-secondary"
ng-click="load_node()">cancel</button>
ng-click="load_node()"><%=l 'cancel' %></button>
<button class="btn btn-primary"
ng-click="update_node()"
ng-disabled="!formNode.$valid || formNode.$pristine
......
......@@ -24,11 +24,10 @@
ng-click="remove_node(node.id)"
>Yes</button>
<button onclick="location='/admin/nodes'">Cancel</button>
<button onclick="location='/admin/nodes'"><%=l 'Cancel' %></button>
</div>
</div>
</div>
<div ng-show="message">{{message}}</div>
......@@ -108,7 +108,7 @@
<div class="col-md-7">
<span><%=l 'Purge disk volumes' %></span>
<div ng-hide="showmachine.has_backups">
This virtual machine has no backups to purge
<%=l 'This virtual machine has no backups to purge' %>
</div>
</div>
</div>
......
......@@ -9,25 +9,25 @@
</div>
<div class="row">
<div class="col-md-12">
<label for="description">Description</label>
<label for="description"><%=l 'Description' %></label>
<textarea ng-model="booking.description"></textarea>
</div>
</div>
<div class="row">
<div class="col-md-2">Start</div>
<div class="col-md-2"><%=l 'Start' %></div>
<div class="col-md-5">
<input type="date" ng-model="booking.date_start" required/>
</div>
</div>
<div class="row">
<div class="col-md-2">End</div>
<div class="col-md-2"><%=l 'End' %></div>
<div class="col-md-5">
<input type="date" ng-model="booking.date_end" required/>
</div>
</div>
<div class="row">
<div class="col-md-2">Time</div>
<div class="col-md-2"><%=l 'Time' %></div>
<div class="col-md-5">
<input type="text" ng-model="booking.time_start" min="00:00" max="23:59"
required
......@@ -72,7 +72,7 @@ my %dow = (
ng-model="booking.ldap_groups" required></select>
</div>
<div class="col-md-2">
<span class="badge badge-primary">add</span>
<span class="badge badge-primary"><%=l 'add' %></span>
</div>
</div>
......@@ -81,7 +81,7 @@ my %dow = (
<button ng-click="save_booking()"
ng-disabled="!form_booking.$valid || form_booking.$pristine
|| booking.day_of_week == '0000000'">
save
<%=l 'save' %>
</button>
</div>
</div>
......
......@@ -3,7 +3,7 @@
<div class="panel-body" ng-show="showmachine.is_base">
<div class="row">
<div class="col-md-2">
Pool
<%=l 'Pool' %>
</div>
<div class="col-md-2">
<input type="checkbox" ng-checked="showmachine.pools==1"
......@@ -15,7 +15,7 @@
</div>
<div class="row">
<div class="col-md-2">
Clones
<%=l 'Clones' %>
</div>
<div class="col-md-2">
<input type="number" size="2" ng-model="showmachine.pool_clones"
......@@ -26,7 +26,7 @@
>
</div>
<div class="col-mg-4">
<small class="text-secondary">Virtual machines in the pool.</small>
<small class="text-secondary"><%= 'Virtual machines in the pool.' %></small>
</div>
</div>
<div class="row">
......@@ -48,14 +48,17 @@
</div>
<div class="col-mg-4" ng-hide="showmachine.volatile_clones">
<small class="text-secondary">
Virtual machines pre-started
<%=l 'Virtual machines pre-started' %>
</small>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div ng-show="showmachine.pools && showmachine.pool_clones >0 && showmachine.is_base==0">Warning: this virtual machine will be prepared as a base. This may take long.
<div ng-show="showmachine.pools &&
showmachine.pool_clones >0 &&
showmachine.is_base==0">
<%=l 'Warning: this virtual machine will be prepared as a base. This may take long.' %>
</div>
<div ng-show="showmachine.pool_start > showmachine.pool_clones"
class="alert alert-danger"
......@@ -77,10 +80,9 @@
</div>
<div class="col-mg-4">
<small class="text-secondary">
Assign this virtual machine to the pre-started pool
<%=l 'Assign this virtual machine to the pre-started pool' %>
</small>
</div>
</div>
</div>
</div>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment