[Libreoffice-commits] online.git: loleaflet/build loleaflet/dist loleaflet/Makefile loleaflet/src
Andras Timar
andras.timar at collabora.com
Tue May 31 21:35:10 UTC 2016
loleaflet/Makefile | 7 ++++
loleaflet/build/adminDeps.js | 5 +++
loleaflet/dist/admin/admin.html | 42 ++++++++++++++++-------------
loleaflet/dist/admin/adminAnalytics.html | 21 ++++++++------
loleaflet/dist/admin/adminSettings.html | 32 ++++++++++++----------
loleaflet/src/admin/AdminSocketBase.js | 2 -
loleaflet/src/admin/AdminSocketOverview.js | 2 -
loleaflet/src/admin/AdminStrings.js | 24 ++++++++++++++++
loleaflet/src/admin/Util.js | 8 ++---
9 files changed, 96 insertions(+), 47 deletions(-)
New commits:
commit 4b7261344759e5227dcc23eed166c352810c2d18
Author: Andras Timar <andras.timar at collabora.com>
Date: Tue May 31 23:26:02 2016 +0200
loleaflet: bccu#1649 l10n of Admin Console
diff --git a/loleaflet/Makefile b/loleaflet/Makefile
index ab851c1..1fb1998 100644
--- a/loleaflet/Makefile
+++ b/loleaflet/Makefile
@@ -33,10 +33,15 @@ pot:
unocommands.js \
dist/errormessages.js \
dist/toolbar/toolbar.js \
- src/control/Control.Tabs.js \
+ src/admin/AdminSocketBase.js \
+ src/admin/AdminSocketOverview.js \
+ src/admin/AdminStrings.js \
+ src/admin/Util.js \
src/control/Control.Menubar.js \
+ src/control/Control.Tabs.js \
src/core/Socket.js \
src/map/Map.js
+
html2po --pot --input=dist/loleaflet-help.html --output=po/loleaflet-help.pot
l10n: pot
diff --git a/loleaflet/build/adminDeps.js b/loleaflet/build/adminDeps.js
index 25757c4..730296f 100644
--- a/loleaflet/build/adminDeps.js
+++ b/loleaflet/build/adminDeps.js
@@ -32,6 +32,11 @@ var adminDeps = {
src: ['admin/AdminSocketSettings.js'],
desc: 'Socket to handle settings from server',
deps: ['AdminSocketBase']
+ },
+
+ AdminStrings: {
+ src: ['admin/AdminStrings.js'],
+ desc: 'String table for user interface'
}
};
diff --git a/loleaflet/dist/admin/admin.html b/loleaflet/dist/admin/admin.html
index d03a6ef..ef4a209 100644
--- a/loleaflet/dist/admin/admin.html
+++ b/loleaflet/dist/admin/admin.html
@@ -27,14 +27,20 @@
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
+ <link rel="localizations" href="/loleaflet/dist/l10n/localizations.json" type="application/vnd.oftn.l10n+json"/>
</head>
-
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
- <script>window.jQuery || document.write('<script src="bootstrap/assets/js/vendor/jquery.min.js"><\/script>')</script>
+ <script>window.jQuery || document.write('<script src="../bootstrap/assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="../dialog/vex.combined.min.js"></script>
+ <script src="/loleaflet/dist/l10n/json2.min.js"></script>
+ <script src="/loleaflet/dist/l10n/l10n.min.js"></script>
+ <script>var _ = function (string) {return string.toLocaleString();};</script>
+ <script src="/loleaflet/dist/branding.js"></script>
<script src="admin-src.js"></script>
<script>vex.defaultOptions.className = 'vex-theme-plain';</script>
+ <script>if (brandProductName) {strProductName = brandProductName}</script>
+ <script>document.title = strProductName + ' - ' + strAdminConsole</script>
<script>
if (window.location.protocol == "https:") {
@@ -51,16 +57,16 @@
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
- <span class="sr-only">Toggle navigation</span>
+ <span class="sr-only"><script>document.write(strToggleNavigation)</script></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
- <a class="navbar-brand" href="#">LibreOffice Online - Admin console</a>
+ <a class="navbar-brand" href="#"><script>document.write(strProductName + ' - ' + strAdminConsole)</script></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
- <li><a href="adminSettings.html">Settings</a></li>
+ <li><a href="adminSettings.html"><script>document.write(strSettings)</script></a></li>
</ul>
</div>
</div>
@@ -70,38 +76,38 @@
<div class="row">
<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
- <li class="active"><a href="#">Overview <span class="sr-only">(current)</span></a></li>
- <li><a href="adminAnalytics.html">Analytics</a></li>
+ <li class="active"><a href="#"><script>document.write(strOverview)</script> <span class="sr-only"><script>document.write(strCurrent)</script></span></a></li>
+ <li><a href="adminAnalytics.html"><script>document.write(strAnalytics)</script></a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
- <h1 class="page-header">Dashboard</h1>
+ <h1 class="page-header"><script>document.write(strDashboard)</script></h1>
<div class="row placeholders">
<div class="col-xs-6 col-sm-3 placeholder">
<div class="main-data" id="active_users_count">0</div>
- <h4>Users online</h4>
+ <h4><script>document.write(strUsersOnline)</script></h4>
</div>
<div class="col-xs-6 col-sm-3 placeholder">
<div class="main-data" id="active_docs_count">0</div>
- <h4>Documents opened</h4>
+ <h4><script>document.write(strDocumentsOpened)</script></h4>
</div>
<div class="col-xs-6 col-sm-3 placeholder">
<div class="main-data" id="total_mem">0</div>
- <h4>Memory consumed</h4>
+ <h4><script>document.write(strMemoryConsumed)</script></h4>
</div>
</div>
- <h2 class="sub-header">Documents opened</h2>
+ <h2 class="sub-header"><script>document.write(strDocumentsOpened)</script></h2>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
- <th>PID</th>
- <th>Document</th>
- <th>Number of views</th>
- <th>Memory consumed</th>
- <th>Elapsed time</th>
+ <th><script>document.write(strPid)</script></th>
+ <th><script>document.write(strDocument)</script></th>
+ <th><script>document.write(strNumberOfViews)</script></th>
+ <th><script>document.write(strMemoryConsumed)</script></th>
+ <th><script>document.write(strElapsedTime)</script></th>
</tr>
</thead>
<tbody id="doclist">
@@ -114,7 +120,7 @@
<div id="rowContextMenu" class="dropdown clearfix">
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu" style="display:block;position:static;margin-bottom:5px;">
- <li><a tabindex="-1" href="#">Kill</a></li>
+ <li><a tabindex="-1" href="#"><script>document.write(strKill)</script></a></li>
</ul>
</div>
diff --git a/loleaflet/dist/admin/adminAnalytics.html b/loleaflet/dist/admin/adminAnalytics.html
index daa135c..23ad622 100644
--- a/loleaflet/dist/admin/adminAnalytics.html
+++ b/loleaflet/dist/admin/adminAnalytics.html
@@ -27,15 +27,22 @@
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
+ <link rel="localizations" href="/loleaflet/dist/l10n/localizations.json" type="application/vnd.oftn.l10n+json"/>
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="../bootstrap/assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="../dialog/vex.combined.min.js"></script>
+ <script src="/loleaflet/dist/l10n/json2.min.js"></script>
+ <script src="/loleaflet/dist/l10n/l10n.min.js"></script>
+ <script>var _ = function (string) {return string.toLocaleString();};</script>
+ <script src="/loleaflet/dist/branding.js"></script>
<script>vex.defaultOptions.className = 'vex-theme-plain';</script>
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="admin-src.js"></script>
+ <script>if (brandProductName) {strProductName = brandProductName}</script>
+ <script>document.title = strProductName + ' - ' + strAdminConsole</script>
<script>
if (window.location.protocol == "https:") {
@@ -52,16 +59,16 @@
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
- <span class="sr-only">Toggle navigation</span>
+ <span class="sr-only"><script>document.write(strToggleNavigation)</script></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
- <a class="navbar-brand" href="#">LibreOffice Online - Admin console</a>
+ <a class="navbar-brand" href="#"><script>document.write(strProductName + ' - ' + strAdminConsole)</script></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
- <li><a href="adminSettings.html">Settings</a></li>
+ <li><a href="adminSettings.html"><script>document.write(strSettings)</script></a></li>
</ul>
</div>
</div>
@@ -71,12 +78,12 @@
<div class="row">
<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
- <li><a href="admin.html">Overview <span class="sr-only">(current)</span></a></li>
- <li class="active"><a href="adminAnalytics.html">Analytics</a></li>
+ <li><a href="admin.html"><script>document.write(strOverview)</script> <span class="sr-only"><script>document.write(strCurrent)</script></span></a></li>
+ <li class="active"><a href="adminAnalytics.html"><script>document.write(strAnalytics)</script></a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
- <h1 class="page-header">Graphs</h1>
+ <h1 class="page-header"><script>document.write(strGraphs)</script></h1>
<div class="graph-container">
<div class="jumbotron">
<svg id="visualisation" width="1000" height="500"></svg>
@@ -89,8 +96,6 @@
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
- <script>window.jQuery || document.write('<script src="../bootstrap/js/vendor/jquery.min.js"><\/script>')</script>
<script src="../bootstrap/js/bootstrap.min.js"></script>
<!-- Just to make our placeholder images work. Don't actually copy the next line! -->
<script src="../bootstrap/assets/js/vendor/holder.min.js"></script>
diff --git a/loleaflet/dist/admin/adminSettings.html b/loleaflet/dist/admin/adminSettings.html
index 307226c..351d4c0 100644
--- a/loleaflet/dist/admin/adminSettings.html
+++ b/loleaflet/dist/admin/adminSettings.html
@@ -27,14 +27,21 @@
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
+ <link rel="localizations" href="/loleaflet/dist/l10n/localizations.json" type="application/vnd.oftn.l10n+json"/>
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="../bootstrap/assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="../dialog/vex.combined.min.js"></script>
+ <script src="/loleaflet/dist/l10n/json2.min.js"></script>
+ <script src="/loleaflet/dist/l10n/l10n.min.js"></script>
+ <script>var _ = function (string) {return string.toLocaleString();};</script>
+ <script src="/loleaflet/dist/branding.js"></script>
<script>vex.defaultOptions.className = 'vex-theme-plain';</script>
<script src="admin-src.js"></script>
+ <script>if (brandProductName) {strProductName = brandProductName}</script>
+ <script>document.title = strProductName + ' - ' + strAdminConsole</script>
<script>
if (window.location.protocol == "https:") {
@@ -51,16 +58,16 @@
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
- <span class="sr-only">Toggle navigation</span>
+ <span class="sr-only"><script>document.write(strToggleNavigation)</script></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
- <a class="navbar-brand" href="#">LibreOffice Online - Admin console</a>
+ <a class="navbar-brand" href="#"><script>document.write(strProductName + ' - ' + strAdminConsole)</script></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
- <li><a href="adminSettings.html">Settings</a></li>
+ <li><a href="adminSettings.html"><script>document.write(strSettings)</script></a></li>
</ul>
</div>
</div>
@@ -70,23 +77,22 @@
<div class="row">
<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
- <li><a href="admin.html">Overview <span class="sr-only">(current)</span></a></li>
- <li><a href="adminAnalytics.html">Analytics</a></li>
+ <li><a href="admin.html"><script>document.write(strOverview)</script> <span class="sr-only"><script>document.write(strCurrent)</script></span></a></li>
+ <li><a href="adminAnalytics.html"><script>document.write(strAnalytics)</script></a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
- <h1 class="page-header">Settings</h1>
+ <h1 class="page-header"><script>document.write(strSettings)</script></h1>
<form id="admin_settings">
- <label for="mem_stats_size">Memory Stats Cache size</label>
+ <label for="mem_stats_size"><script>document.write(strMemoryStatsCachesize)</script></label>
<input type="text" id="mem_stats_size" name="Memory Stats Size"><br/>
- <label for="mem_stats_interval">Memory Stats Interval (in ms)</label>
+ <label for="mem_stats_interval"><script>document.write(strMemoryStatsInterval)</script></label>
<input type="text" id="mem_stats_interval" name="Memory Stats Interval"><br/>
-
- <label for="cpu_stats_size">Cpu Stats Cache size</label>
+ <label for="cpu_stats_size"><script>document.write(strCpuStatsCachesize)</script></label>
<input type="text" id="cpu_stats_size" name="Cpu Stats Size"><br/>
- <label for="cpu_stats_interval">Cpu Stats Interval (in ms)</label>
+ <label for="cpu_stats_interval"><script>document.write(strCpuStatsInterval)</script></label>
<input type="text" id="cpu_stats_interval" name="Cpu Stats Interval"><br/>
- <input type="submit" value="Save"/><br/>
+ <script>document.write('<input type="submit" value="' + strSave + '"/><br/>')</script>
</form>
</div>
</div>
@@ -96,8 +102,6 @@
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
- <script>window.jQuery || document.write('<script src="../bootstrap/assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="../bootstrap/js/bootstrap.min.js"></script>
<!-- Just to make our placeholder images work. Don't actually copy the next line! -->
<script src="../bootstrap/assets/js/vendor/holder.min.js"></script>
diff --git a/loleaflet/src/admin/AdminSocketBase.js b/loleaflet/src/admin/AdminSocketBase.js
index a18fa4d..48720df 100644
--- a/loleaflet/src/admin/AdminSocketBase.js
+++ b/loleaflet/src/admin/AdminSocketBase.js
@@ -41,6 +41,6 @@ var AdminSocketBase = Base.extend({
},
onSocketError: function() {
- vex.dialog.alert('Connection error');
+ vex.dialog.alert(_('Connection error'));
}
});
diff --git a/loleaflet/src/admin/AdminSocketOverview.js b/loleaflet/src/admin/AdminSocketOverview.js
index ed1d0b0..b55a833 100644
--- a/loleaflet/src/admin/AdminSocketOverview.js
+++ b/loleaflet/src/admin/AdminSocketOverview.js
@@ -55,7 +55,7 @@ var AdminSocketOverview = AdminSocketBase.extend({
$('#rowContextMenu').on('click', 'a', function() {
vex.dialog.confirm({
- message: 'Are you sure you want to terminate this session?',
+ message: _('Are you sure you want to terminate this session?'),
callback: function(value) {
if (value) {
var killPid = ($('#rowContextMenu').data('rowToKill')).substring('doc'.length);
diff --git a/loleaflet/src/admin/AdminStrings.js b/loleaflet/src/admin/AdminStrings.js
new file mode 100644
index 0000000..c90ab58
--- /dev/null
+++ b/loleaflet/src/admin/AdminStrings.js
@@ -0,0 +1,24 @@
+/* Stringtable for Admin Console User Interface */
+
+var strProductName = 'LibreOffice Online';
+var strAdminConsole = _('Admin console');
+var strToggleNavigation = _('Toggle navigation');
+var strSettings = _('Settings');
+var strOverview = _('Overview');
+var strCurrent = _('(current)');
+var strAnalytics = _('Analytics');
+var strDashboard = _('Dashboard');
+var strUsersOnline = _('Users online');
+var strDocumentsOpened = _('Documents opened');
+var strMemoryConsumed = _('Memory consumed');
+var strPid = _('PID');
+var strDocument = _('Document');
+var strNumberOfViews = _('Number of views');
+var strElapsedTime = _('Elapsed time');
+var strKill = _('Kill');
+var strGraphs = _('Graphs');
+var strSave = _('Save');
+var strMemoryStatsCachesize = _('Cache size of memory statistics');
+var strMemoryStatsInterval = _('Time interval of memory statistics (in ms)');
+var strCpuStatsCachesize = _('Cache size of CPU statistics');
+var strCpuStatsInterval = _('Time interval of CPU statistics (in ms)');
diff --git a/loleaflet/src/admin/Util.js b/loleaflet/src/admin/Util.js
index d775762..c208763 100644
--- a/loleaflet/src/admin/Util.js
+++ b/loleaflet/src/admin/Util.js
@@ -10,7 +10,7 @@ var Util = Base.extend({
humanizeMem: function (kbytes) {
var unit = 1000;
- var units = ['kB', 'MB', 'GB', 'TB'];
+ var units = [_('kB'), _('MB'), _('GB'), _('TB')];
for (var i = 0; Math.abs(kbytes) >= unit && i < units.length; i++) {
kbytes /= unit;
}
@@ -38,11 +38,11 @@ var Util = Base.extend({
}
if (hrs) {
- res = hrs + ':' + mins + ' hrs';
+ res = hrs + ':' + mins + _(' hrs');
} else if (mins) {
- res = mins + ':' + secs + ' mins';
+ res = mins + ':' + secs + _(' mins');
} else if (secs) {
- res = secs + ' s';
+ res = secs + _(' s');
} else {
res = '';
}
More information about the Libreoffice-commits
mailing list