Skip to content

Commit

Permalink
Translatable error message for host app error
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Vogt committed Apr 3, 2018
1 parent ad3ef46 commit e840cab
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
7 changes: 5 additions & 2 deletions src/_locales/de/messages.json
Expand Up @@ -200,8 +200,11 @@
"passff_newpassword_errors_unexpected_error": {
"message": "Ein unerwarteter Fehler ist aufgetreten."
},
"passff_errors_unexpected_error": {
"message": "Ein unerwarteter Fehler ist aufgetreten. Stellen Sie sicher, dass die Einstellungen korrekt sind und dass die Host-App installiert ist."
"passff_errors_exec_host_app": {
"message": "Die Verbindung zur Host-App ist fehlgeschlagen oder lieferte ein unerwartetes Ergebnis!"
},
"passff_errors_upgrade_host_app": {
"message": "Stellen Sie sicher, dass die aktuellste Version der PassFF-Host-App installiert ist, indem Sie den {Installationsanweisungen auf GitHub} folgen."
},
"passff_no_entries_found": {
"message": "Keine passenden Einträge für diese URL."
Expand Down
7 changes: 5 additions & 2 deletions src/_locales/en/messages.json
Expand Up @@ -200,8 +200,11 @@
"passff_newpassword_errors_unexpected_error": {
"message": "Sorry, an unexpected error occurred!"
},
"passff_errors_unexpected_error": {
"message": "Sorry, an unexpected error occurred. Make sure your preferences are correctly set and that the host app is installed."
"passff_errors_exec_host_app": {
"message": "Connection to the host app failed or returned an unexpected result!"
},
"passff_errors_upgrade_host_app": {
"message": "Make sure you have the latest version of the PassFF host app installed by following the {installation instructions on GitHub}."
},
"passff_no_entries_found": {
"message": "No entries matching this URL."
Expand Down
9 changes: 2 additions & 7 deletions src/content/menu.html
Expand Up @@ -11,13 +11,8 @@
</head>
<body id="menu">
<div class="message error">
<p>Connection to the host app failed or returned an unexpected result!</p>
<p>
Make sure you have the latest version of the PassFF host app
installed by following the
<a href="https://github.com/passff/passff/blob/master/docs/INSTALLATION.md"
>installation instructions on GitHub</a>.
</p>
<p>passff_errors_exec_host_app</p>
<p>passff_errors_upgrade_host_app</p>
</div>
<div class="searchbar">
<input type="text" id="passff-search-box" />
Expand Down
7 changes: 7 additions & 0 deletions src/modules/menu.js
Expand Up @@ -394,6 +394,13 @@ PassFF.Menu = (function () {
*/

function init_ui() {
let errorBoxMsgs = document.querySelectorAll('div.message.error p');
[].forEach.call(errorBoxMsgs, function (p) {
p.textContent = _(p.textContent);
p.innerHTML = p.innerHTML.replace(/\{([^\}]+)\}/,
"<a href=\"https://github.com/passff/passff/blob/master/docs/INSTALLATION.md\">$1</a>");
});

let searchBox = document.getElementById('passff-search-box');
searchBox.setAttribute('placeholder',
_('passff_toolbar_search_placeholder'));
Expand Down

0 comments on commit e840cab

Please sign in to comment.