i18n: Localize /admin pages (#4380)

Not every string was localized:

  * `/admin/plugins` has some CSS magic to draw the tables of plugins
    differently on narrow (mobile) screens, and the l10n library we
    use does not support that particular magic. The strings that were
    not localized are "Name", "Description", "Version", and "Time".
    These strings are only stuck in English when the page is viewed on
    a narrow screen; normal desktop users will see translated strings.
    The CSS magic ought to be replaced with something more robust
    (lots of nested `div`s); those remaining strings can be localized
    whenever that happens.

  * Strings from external sources such as plugin descriptions, error
    messages, and `settings.json` comments are not localized.
This commit is contained in:
Richard Hansen 2020-10-01 05:15:27 -04:00 committed by GitHub
parent 554eef7770
commit dbef630f44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 91 additions and 46 deletions

View file

@ -1,4 +1,38 @@
{ {
"admin.page-title": "Admin Dashboard - Etherpad",
"admin_plugins": "Plugin manager",
"admin_plugins.available": "Available plugins",
"admin_plugins.available_not-found": "No plugins found.",
"admin_plugins.available_fetching": "Fetching…",
"admin_plugins.available_install.value": "Install",
"admin_plugins.available_search.placeholder": "Search for plugins to install",
"admin_plugins.description": "Description",
"admin_plugins.installed": "Installed plugins",
"admin_plugins.installed_fetching": "Fetching installed plugins…",
"admin_plugins.installed_nothing": "You haven't installed any plugins yet.",
"admin_plugins.installed_uninstall.value": "Uninstall",
"admin_plugins.last-update": "Last update",
"admin_plugins.name": "Name",
"admin_plugins.page-title": "Plugin manager - Etherpad",
"admin_plugins.version": "Version",
"admin_plugins_info": "Troubleshooting information",
"admin_plugins_info.hooks": "Installed hooks",
"admin_plugins_info.hooks_client": "Client-side hooks",
"admin_plugins_info.hooks_server": "Server-side hooks",
"admin_plugins_info.parts": "Installed parts",
"admin_plugins_info.plugins": "Installed plugins",
"admin_plugins_info.page-title": "Plugin information - Etherpad",
"admin_plugins_info.version": "Etherpad version",
"admin_plugins_info.version_latest": "Latest available version",
"admin_plugins_info.version_number": "Version number",
"admin_settings": "Settings",
"admin_settings.current": "Current configuration",
"admin_settings.current_example-devel": "Example development settings template",
"admin_settings.current_example-prod": "Example production settings template",
"admin_settings.current_restart.value": "Restart Etherpad",
"admin_settings.current_save.value": "Save Settings",
"admin_settings.page-title": "Settings - Etherpad",
"index.newPad": "New Pad", "index.newPad": "New Pad",
"index.createOpenPad": "or create/open a Pad with the name:", "index.createOpenPad": "or create/open a Pad with the name:",
"index.openPad": "open an existing Pad with the name:", "index.openPad": "open an existing Pad with the name:",

View file

@ -1,11 +1,14 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<title>Admin Dashboard - Etherpad</title> <title data-l10n-id="admin.page-title">Admin Dashboard - Etherpad</title>
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="../static/css/admin.css"> <link rel="stylesheet" href="../static/css/admin.css">
<script src="../static/js/jquery.js"></script> <script src="../static/js/jquery.js"></script>
<script src="../socket.io/socket.io.js"></script> <script src="../socket.io/socket.io.js"></script>
<link rel="localizations" type="application/l10n+json" href="../locales.json" />
<script src="../static/js/html10n.js"></script>
<script src="../static/js/l10n.js"></script>
</head> </head>
<body> <body>
<div id="wrapper"> <div id="wrapper">
@ -13,9 +16,9 @@
<h1><a href="../">Etherpad</a></h1> <h1><a href="../">Etherpad</a></h1>
<ul> <ul>
<% e.begin_block("adminMenu"); %> <% e.begin_block("adminMenu"); %>
<li><a href="plugins">Plugin manager</a> </li> <li><a href="plugins" data-l10n-id="admin_plugins">Plugin manager</a></li>
<li><a href="settings">Settings</a> </li> <li><a href="settings" data-l10n-id="admin_settings">Settings</a></li>
<li><a href="plugins/info">Troubleshooting information</a> </li> <li><a href="plugins/info" data-l10n-id="admin_plugins_info">Troubleshooting information</a></li>
<% e.end_block(); %> <% e.end_block(); %>
</ul> </ul>
</div> </div>

View file

@ -4,9 +4,12 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<title>Plugin information - Etherpad</title> <title data-l10n-id="admin_plugins_info.page-title">Plugin information - Etherpad</title>
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="../../static/css/admin.css"> <link rel="stylesheet" href="../../static/css/admin.css">
<link rel="localizations" type="application/l10n+json" href="../../locales.json" />
<script src="../../static/js/html10n.js"></script>
<script src="../../static/js/l10n.js"></script>
</head> </head>
<body> <body>
<div id="wrapper"> <div id="wrapper">
@ -14,30 +17,30 @@
<h1><a href="../../">Etherpad</a></h1> <h1><a href="../../">Etherpad</a></h1>
<ul> <ul>
<% e.begin_block("adminMenu"); %> <% e.begin_block("adminMenu"); %>
<li><a href="../plugins">Plugin manager</a> </li> <li><a href="../plugins" data-l10n-id="admin_plugins">Plugin manager</a></li>
<li><a href="../settings">Settings</a> </li> <li><a href="../settings" data-l10n-id="admin_settings">Settings</a></li>
<li><a href="../plugins/info">Troubleshooting information</a> </li> <li><a href="../plugins/info" data-l10n-id="admin_plugins_info">Troubleshooting information</a></li>
<% e.end_block(); %> <% e.end_block(); %>
</ul> </ul>
</div> </div>
<div class="innerwrapper"> <div class="innerwrapper">
<h2>Etherpad version</h2> <h2 data-l10n-id="admin_plugins_info.version">Etherpad version</h2>
<p>Version number: <%= epVersion %></p> <p><span data-l10n-id="admin_plugins_info.version_number">Version number</span>: <%= epVersion %></p>
<p>Latest available version: <%= latestVersion %></p> <p><span data-l10n-id="admin_plugins_info.version_latest">Latest available version</span>: <%= latestVersion %></p>
<p>Git sha: <a href='https://github.com/ether/etherpad-lite/commit/<%= gitCommit %>'><%= gitCommit %></a></p> <p>Git sha: <a href='https://github.com/ether/etherpad-lite/commit/<%= gitCommit %>'><%= gitCommit %></a></p>
<h2>Installed plugins</h2> <h2 data-l10n-id="admin_plugins_info.plugins">Installed plugins</h2>
<pre><%- plugins.formatPlugins().replace(/, /g,"\n") %></pre> <pre><%- plugins.formatPlugins().replace(/, /g,"\n") %></pre>
<h2>Installed parts</h2> <h2 data-l10n-id="admin_plugins_info.parts">Installed parts</h2>
<pre><%= plugins.formatParts() %></pre> <pre><%= plugins.formatParts() %></pre>
<h2>Installed hooks</h2> <h2 data-l10n-id="admin_plugins_info.hooks">Installed hooks</h2>
<h3>Server side hooks</h3> <h3 data-l10n-id="admin_plugins_info.hooks_server">Server-side hooks</h3>
<div><%- plugins.formatHooks() %></div> <div><%- plugins.formatHooks() %></div>
<h3>Client side hooks</h3> <h3 data-l10n-id="admin_plugins_info.hooks_client">Client-side hooks</h3>
<div><%- plugins.formatHooks("client_hooks") %></div> <div><%- plugins.formatHooks("client_hooks") %></div>
</div> </div>

View file

@ -1,12 +1,15 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<title>Plugin manager - Etherpad</title> <title data-l10n-id="admin_plugins.page-title">Plugin manager - Etherpad</title>
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="../static/css/admin.css"> <link rel="stylesheet" href="../static/css/admin.css">
<script src="../static/js/jquery.js"></script> <script src="../static/js/jquery.js"></script>
<script src="../socket.io/socket.io.js"></script> <script src="../socket.io/socket.io.js"></script>
<script src="../static/js/admin/plugins.js"></script> <script src="../static/js/admin/plugins.js"></script>
<link rel="localizations" type="application/l10n+json" href="../locales.json" />
<script src="../static/js/html10n.js"></script>
<script src="../static/js/l10n.js"></script>
</head> </head>
<body> <body>
<div id="wrapper"> <div id="wrapper">
@ -23,21 +26,21 @@
<h1><a href="../">Etherpad</a></h1> <h1><a href="../">Etherpad</a></h1>
<ul> <ul>
<% e.begin_block("adminMenu"); %> <% e.begin_block("adminMenu"); %>
<li><a href="plugins">Plugin manager</a> </li> <li><a href="plugins" data-l10n-id="admin_plugins">Plugin manager</a></li>
<li><a href="settings">Settings</a> </li> <li><a href="settings" data-l10n-id="admin_settings">Settings</a></li>
<li><a href="plugins/info">Troubleshooting information</a> </li> <li><a href="plugins/info" data-l10n-id="admin_plugins_info">Troubleshooting information</a></li>
<% e.end_block(); %> <% e.end_block(); %>
</ul> </ul>
</div> </div>
<div class="innerwrapper"> <div class="innerwrapper">
<h2>Installed plugins</h2> <h2 data-l10n-id="admin_plugins.installed">Installed plugins</h2>
<table class="installed-results"> <table class="installed-results">
<thead> <thead>
<tr> <tr>
<th>Name</th> <th data-l10n-id="admin_plugins.name">Name</th>
<th>Description</th> <th data-l10n-id="admin_plugins.description">Description</th>
<th>Version</th> <th data-l10n-id="admin_plugins.version">Version</th>
<td></td> <td></td>
</tr> </tr>
</thead> </thead>
@ -48,7 +51,7 @@
<td class="version" data-label="Version"></td> <td class="version" data-label="Version"></td>
<td> <td>
<div class="actions"> <div class="actions">
<input type="button" value="Uninstall" class="do-uninstall"> <input type="button" value="Uninstall" class="do-uninstall" data-l10n-id="admin_plugins.installed_uninstall.value">
<div class="progress"><p class="loadingAnimation"></p><p><span class="message"></span></p></div> <div class="progress"><p class="loadingAnimation"></p><p><span class="message"></span></p></div>
</div> </div>
</td> </td>
@ -58,8 +61,8 @@
</tbody> </tbody>
<tbody class="messages"> <tbody class="messages">
<tr><td></td><td> <tr><td></td><td>
<p class="nothing-installed">You haven't installed any plugins yet.</p> <p class="nothing-installed" data-l10n-id="admin_plugins.installed_nothing">You haven't installed any plugins yet.</p>
<p class="fetching"><p class="loadingAnimation"></p><br/>Fetching installed plugins...</p> <p class="fetching"><p class="loadingAnimation"></p><br/><span data-l10n-id="admin_plugins.installed_fetching">Fetching installed plugins…</span></p>
</td><td></td></tr> </td><td></td></tr>
</tbody> </tbody>
</table> </table>
@ -67,18 +70,18 @@
<div class="paged listing search-results"> <div class="paged listing search-results">
<div class="separator"></div> <div class="separator"></div>
<h2>Available plugins</h2> <h2 data-l10n-id="admin_plugins.available">Available plugins</h2>
<form> <form>
<input type="text" name="search" disabled placeholder="Search for plugins to install" id="search-query"> <input type="text" name="search" disabled placeholder="Search for plugins to install" id="search-query" data-l10n-id="admin_plugins.available_search.placeholder">
</form> </form>
<table> <table>
<thead> <thead>
<tr> <tr>
<th class="sort up" data-label="name">Name</th> <th class="sort up" data-label="name" data-l10n-id="admin_plugins.name">Name</th>
<th class="sort none" data-label="description">Description</th> <th class="sort none" data-label="description" data-l10n-id="admin_plugins.description">Description</th>
<th class="sort none" data-label="version">Version</th> <th class="sort none" data-label="version" data-l10n-id="admin_plugins.version">Version</th>
<th class="sort none" data-label="time">Last update</th> <th class="sort none" data-label="time" data-l10n-id="admin_plugins.last-update">Last update</th>
<td></td> <td></td>
</tr> </tr>
</thead> </thead>
@ -90,7 +93,7 @@
<td class="time" data-label="Time"></td> <td class="time" data-label="Time"></td>
<td> <td>
<div class="actions"> <div class="actions">
<input type="button" value="Install" class="do-install"> <input type="button" value="Install" class="do-install" data-l10n-id="admin_plugins.available_install.value">
<div class="progress"><p><p class="loadingAnimation"></p></p><p><span class="message"></span></p></div> <div class="progress"><p><p class="loadingAnimation"></p></p><p><span class="message"></span></p></div>
</div> </div>
</td> </td>
@ -102,8 +105,8 @@
<tr><td></td><td> <tr><td></td><td>
<div class="messages"> <div class="messages">
<div id="search-progress" class="progress"><p>&nbsp;</p></div> <div id="search-progress" class="progress"><p>&nbsp;</p></div>
<p class="nothing-found">No plugins found.</p> <p class="nothing-found" data-l10n-id="admin_plugins.available_not-found">No plugins found.</p>
<p class="fetching"><p class="loadingAnimation"></p><br/>Fetching...</p> <p class="fetching"><p class="loadingAnimation"></p><br/><span data-l10n-id="admin_plugins.available_fetching">Fetching…</span></p>
</div> </div>
</td><td></td></tr> </td><td></td></tr>
</tbody> </tbody>

View file

@ -1,7 +1,7 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<title>Settings - Etherpad</title> <title data-l10n-id="admin_settings.page-title">Settings - Etherpad</title>
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="../static/css/admin.css"> <link rel="stylesheet" href="../static/css/admin.css">
<script src="../static/js/jquery.js"></script> <script src="../static/js/jquery.js"></script>
@ -9,7 +9,9 @@
<script src="../static/js/admin/minify.json.js"></script> <script src="../static/js/admin/minify.json.js"></script>
<script src="../static/js/admin/settings.js"></script> <script src="../static/js/admin/settings.js"></script>
<script src="../static/js/admin/jquery.autosize.js"></script> <script src="../static/js/admin/jquery.autosize.js"></script>
<link rel="localizations" type="application/l10n+json" href="../locales.json" />
<script src="../static/js/html10n.js"></script>
<script src="../static/js/l10n.js"></script>
</head> </head>
<body> <body>
<div id="wrapper"> <div id="wrapper">
@ -27,22 +29,22 @@
<h1><a href="../">Etherpad</a></h1> <h1><a href="../">Etherpad</a></h1>
<ul> <ul>
<% e.begin_block("adminMenu"); %> <% e.begin_block("adminMenu"); %>
<li><a href="plugins">Plugin manager</a> </li> <li><a href="plugins" data-l10n-id="admin_plugins">Plugin manager</a></li>
<li><a href="settings">Settings</a> </li> <li><a href="settings" data-l10n-id="admin_settings">Settings</a></li>
<li><a href="plugins/info">Troubleshooting information</a> </li> <li><a href="plugins/info" data-l10n-id="admin_plugins_info">Troubleshooting information</a></li>
<% e.end_block(); %> <% e.end_block(); %>
</ul> </ul>
</div> </div>
<div class="innerwrapper"> <div class="innerwrapper">
<h2>Current configuration</h2> <h2 data-l10n-id="admin_settings.current">Current configuration</h2>
<textarea class="settings"></textarea> <textarea class="settings"></textarea>
<input type="button" class="settingsButton" id="saveSettings" value="Save Settings"> <input type="button" class="settingsButton" id="saveSettings" value="Save Settings" data-l10n-id="admin_settings.current_save.value">
<input type="button" class="settingsButton" id="restartEtherpad" value="Restart Etherpad"> <input type="button" class="settingsButton" id="restartEtherpad" value="Restart Etherpad" data-l10n-id="admin_settings.current_restart.value">
<div id="response"></div> <div id="response"></div>
<div class="separator"></div> <div class="separator"></div>
<a href='https://github.com/ether/etherpad-lite/wiki/Example-Production-Settings.JSON'>Example production settings template</a> <a href='https://github.com/ether/etherpad-lite/wiki/Example-Production-Settings.JSON' data-l10n-id="admin_settings.current_example-prod">Example production settings template</a>
<a href='https://github.com/ether/etherpad-lite/wiki/Example-Development-Settings.JSON'>Example development settings template</a> <a href='https://github.com/ether/etherpad-lite/wiki/Example-Development-Settings.JSON' data-l10n-id="admin_settings.current_example-devel">Example development settings template</a>
</div> </div>
<div class="innerwrapper-err" > <div class="innerwrapper-err" >