JS translation

This commit is contained in:
ArthurHoaro 2017-05-20 15:43:55 +02:00
parent 12266213d0
commit 40ec173e68
3 changed files with 20 additions and 6 deletions

View file

@ -138,6 +138,9 @@ window.onload = function () {
}); });
foldAllButton.firstElementChild.classList.toggle('fa-chevron-down'); foldAllButton.firstElementChild.classList.toggle('fa-chevron-down');
foldAllButton.firstElementChild.classList.toggle('fa-chevron-up'); foldAllButton.firstElementChild.classList.toggle('fa-chevron-up');
foldAllButton.title = state === 'down'
? document.getElementById('translation-fold-all').innerHTML
: document.getElementById('translation-expand-all').innerHTML
}); });
}); });
} }
@ -146,7 +149,7 @@ window.onload = function () {
{ {
// Switch fold/expand - up = fold // Switch fold/expand - up = fold
if (button.classList.contains('fa-chevron-up')) { if (button.classList.contains('fa-chevron-up')) {
button.title = 'Expand'; button.title = document.getElementById('translation-expand').innerHTML;
if (description != null) { if (description != null) {
description.style.display = 'none'; description.style.display = 'none';
} }
@ -155,7 +158,7 @@ window.onload = function () {
} }
} }
else { else {
button.title = 'Fold'; button.title = document.getElementById('translation-fold').innerHTML;
if (description != null) { if (description != null) {
description.style.display = 'block'; description.style.display = 'block';
} }
@ -173,7 +176,7 @@ window.onload = function () {
var deleteLinks = document.querySelectorAll('.confirm-delete'); var deleteLinks = document.querySelectorAll('.confirm-delete');
[].forEach.call(deleteLinks, function(deleteLink) { [].forEach.call(deleteLinks, function(deleteLink) {
deleteLink.addEventListener('click', function(event) { deleteLink.addEventListener('click', function(event) {
if(! confirm('Are you sure you want to delete this link ?')) { if(! confirm(document.getElementById('translation-delete-link').innerHTML)) {
event.preventDefault(); event.preventDefault();
} }
}); });
@ -618,7 +621,7 @@ function activateFirefoxSocial(node) {
// Keeping the data separated (ie. not in the DOM) so that it's maintainable and diffable. // Keeping the data separated (ie. not in the DOM) so that it's maintainable and diffable.
var data = { var data = {
name: title, name: title,
description: "The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community.", description: document.getElementById('translation-delete-link').innerHTML,
author: "Shaarli", author: "Shaarli",
version: "1.0.0", version: "1.0.0",

View file

@ -13,7 +13,7 @@
<a href="?untaggedonly" title="{'Filter untagged links'|t}" <a href="?untaggedonly" title="{'Filter untagged links'|t}"
class={if="$untaggedonly"}"filter-on"{else}"filter-off"{/if} class={if="$untaggedonly"}"filter-on"{else}"filter-off"{/if}
><i class="fa fa-tag"></i></a> ><i class="fa fa-tag"></i></a>
<a href="#" class="filter-off fold-all pure-u-lg-0" title="Fold all"> <a href="#" class="filter-off fold-all pure-u-lg-0" title="{'Fold all'|t}">
<i class="fa fa-chevron-up"></i> <i class="fa fa-chevron-up"></i>
</a> </a>
{loop="$action_plugin"} {loop="$action_plugin"}
@ -53,7 +53,7 @@
<form method="GET" class="pure-u-0 pure-u-lg-visible"> <form method="GET" class="pure-u-0 pure-u-lg-visible">
<input type="text" name="linksperpage" placeholder="133"> <input type="text" name="linksperpage" placeholder="133">
</form> </form>
<a href="#" class="filter-off fold-all pure-u-0 pure-u-lg-visible" title="Fold all"> <a href="#" class="filter-off fold-all pure-u-0 pure-u-lg-visible" title="{'Fold all'|t}">
<i class="fa fa-chevron-up"></i> <i class="fa fa-chevron-up"></i>
</a> </a>
</div> </div>

View file

@ -27,6 +27,17 @@
<script src="{$value}#"></script> <script src="{$value}#"></script>
{/loop} {/loop}
<div id="js-translations" class="hidden">
<span id="translation-fold">{'Fold'|t}</span>
<span id="translation-fold-all">{'Fold all'|t}</span>
<span id="translation-expand">{'Expand'|t}</span>
<span id="translation-expand-all">{'Expand all'|t}</span>
<span id="translation-delete-link">{'Are you sure you want to delete this link?'|t}</span>
<span id="translation-shaarli-desc">
{'The personal, minimalist, super-fast, database free, bookmarking service'|t} {'by the Shaarli community'|t}
</span>
</div>
<script src="js/shaarli.js?v={$version_hash}"></script> <script src="js/shaarli.js?v={$version_hash}"></script>
<script src="inc/awesomplete.js?v={$version_hash}#"></script> <script src="inc/awesomplete.js?v={$version_hash}#"></script>
<script src="inc/awesomplete-multiple-tags.js?v={$version_hash}#"></script> <script src="inc/awesomplete-multiple-tags.js?v={$version_hash}#"></script>