Skip to content

Commit

Permalink
French translation
Browse files Browse the repository at this point in the history
  • Loading branch information
grams committed Mar 25, 2017
1 parent 9de111e commit 805b4a4
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 21 deletions.
35 changes: 35 additions & 0 deletions extension/_locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"appName": {
"message": "Task-focused browser tabs"
},
"appDesc": {
"message": "Opens all tabs needed for a task, and saves them for later when switching to another task."
},
"input_add_placeholder": {
"message": "Search..."
},
"TasksLabel": {
"message": "Tasks"
},
"TemplatesLabel": {
"message": "Templates"
},
"renameTaskContextMenu": {
"message": "Rename"
},
"duplicateTaskContextMenu": {
"message": "Duplicate"
},
"templateTaskContextMenu": {
"message": "Make template"
},
"deleteTaskContextMenu": {
"message": "Delete"
},
"cloneTemplateContextMenu": {
"message": "Create task"
},
"deleteTemplateContextMenu": {
"message": "Delete"
}
}
35 changes: 35 additions & 0 deletions extension/_locales/fr/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"appName": {
"message": "Task-focused browser tabs"
},
"appDesc": {
"message": "Ouvre tous les onglets nécessaires quand on ouvre une tâche, puis les sauve pour plus tard quand on change de tâche."
},
"input_add_placeholder": {
"message": "Chercher..."
},
"TasksLabel": {
"message": "Tâches"
},
"TemplatesLabel": {
"message": "Modèles"
},
"renameTaskContextMenu": {
"message": "Renommer"
},
"duplicateTaskContextMenu": {
"message": "Dupliquer"
},
"templateTaskContextMenu": {
"message": "Faire un modèle"
},
"deleteTaskContextMenu": {
"message": "Supprimer"
},
"cloneTemplateContextMenu": {
"message": "Créer une tâche"
},
"deleteTemplateContextMenu": {
"message": "Supprimer"
}
}
Binary file added extension/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extension/icon96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 19 additions & 8 deletions extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
{
"manifest_version": 2,
"name": "Task-focused browser tabs",
"description": "Opens all tabs needed for a task, and saves them for later when switching to another task.",
"version": "1.0.0",
"name": "__MSG_appName__",
"short_name": "Task-focused",
"version": "0.1.1",
"description": "__MSG_appDesc__",
"author": "Guillaume Rams",
"homepage_url": "http://www.schwinl.net/",
"icons": {
"16": "icon16.png",
"24": "icon24.png",
"32": "icon32.png",
"48": "icon48.png",
"128": "icon128.png"
},
"browser_action": {
"default_icon": {
"16": "icon16.png",
"24": "icon24.png",
"32": "icon32.png"
"32": "icon32.png",
"48": "icon48.png",
"128": "icon128.png"
}
},
"default_locale": "en",
"background": {
"scripts": [
"eventPage.js"
Expand All @@ -19,8 +32,6 @@
"permissions": [
"activeTab",
"tabs",
"storage",
"https://ajax.googleapis.com/"
],
"content_security_policy": "script-src 'self' https://ajax.googleapis.com; object-src 'self'"
"storage"
]
}
23 changes: 12 additions & 11 deletions extension/taskFocusedTabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ <h4 style="margin-left: 1em;">Task-focused browser tabs</h4>
<td></td>
</tr>
<tr>
<td><span>Tasks</span></td>
<td><span>Templates</span></td>
<td><span id="TasksLabel">Tasks</span></td>
<td><span id="TemplatesLabel">Templates</span></td>
</tr>
<tr>
<td style='min-width: 50px; width:400px; max-width: 400px; vertical-align: top;'>
Expand Down Expand Up @@ -84,30 +84,31 @@ <h4 class='panel-title'>
<div id='taskContextMenu' class='dropdown clearfix' style='position: absolute;display:none;z-index:10;'>
<ul class='dropdown-menu' role='menu' aria-labelledby='dropdownMenu'
style='display:block;position:static;margin-bottom:5px;'>
<li id='renameTaskContextMenu'>&nbsp;<span class='glyphicon glyphicon-pencil' aria-hidden='true'></span> Rename
</li>
<li id='renameTaskContextMenu'>&nbsp;<span class='glyphicon glyphicon-pencil' aria-hidden='true'></span> <span
id="renameTaskContextMenuLabel">Rename</span></li>
<li id='duplicateTaskContextMenu'>&nbsp;<span class='glyphicon glyphicon-duplicate' aria-hidden='true'></span>
Duplicate
<span id="duplicateTaskContextMenuLabel">Duplicate</span>
</li>
<li class='divider'></li>
<li id='templateTaskContextMenu'>&nbsp;<span class='glyphicon glyphicon-transfer' aria-hidden='true'></span>
Make template
<li id='templateTaskContextMenu'>&nbsp;<span class='glyphicon glyphicon-pushpin' aria-hidden='true'></span>
<span id="templateTaskContextMenuLabel">Make template</span>
</li>
<li class='divider'></li>
<li id='deleteTaskContextMenu'>&nbsp;<span class='glyphicon glyphicon-remove-circle' aria-hidden='true'></span>
Delete
<span id="deleteTaskContextMenuLabel">Delete</span>
</li>
</ul>
</div>
<div id='templateContextMenu' class='dropdown clearfix' style='position: absolute;display:none;z-index:10;'>
<ul class='dropdown-menu' role='menu' aria-labelledby='dropdownMenu'
style='display:block;position:static;margin-bottom:5px;'>
<li id='cloneTemplateContextMenu'>&nbsp;<span class='glyphicon glyphicon-duplicate' aria-hidden='true'></span>
Clone
<li id='cloneTemplateContextMenu'>&nbsp;<span class='glyphicon glyphicon-backward' aria-hidden='true'></span>
<span id="cloneTemplateContextMenuLabel">Clone</span>
</li>
<li class='divider'></li>
<li id='deleteTemplateContextMenu'>&nbsp;<span class='glyphicon glyphicon-remove-circle'
aria-hidden='true'></span> Delete
aria-hidden='true'></span> <span
id="deleteTemplateContextMenuLabel">Delete</span>
</li>
</ul>
</div>
Expand Down
33 changes: 31 additions & 2 deletions extension/taskFocusedTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ function addBtn(aTask, atFirstPosition) {
}
}

// Jump first?
var jumpToFirstOnActivation = true;
if (jumpToFirstOnActivation) {
$task.prependTo("#tasks");
}

// Now open all tabs of selected task
var index = $task.index();
var tabs = $task.data("tabs");
Expand Down Expand Up @@ -337,6 +343,8 @@ function init() {
$(function () {
console.debug("INIT");

translate();

chrome.storage.sync.get(null, function (items) {
if (chrome.runtime.lastError) {
console.error("Error while reading tasks from storage:", chrome.runtime.lastError);
Expand Down Expand Up @@ -392,11 +400,16 @@ $(function () {
}
else {
var tasksMatching = $tasks.find("li .title").each(function () {
if ($(this).text().toLocaleLowerCase().indexOf(matchString) != -1) {
if ($(this).parent().hasClass("active")) {
$(this).parent().show();
}
else {
$(this).parent().hide();
if ($(this).text().toLocaleLowerCase().indexOf(matchString) != -1) {
$(this).parent().show();
}
else {
$(this).parent().hide();
}
}
});
var tasksMatching = $templates.find("li .title").each(function () {
Expand Down Expand Up @@ -552,3 +565,19 @@ $(function () {
});
});
});

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Translate UI
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function translate() {
console.debug("Translation");
$("#input-add").attr("placeholder", chrome.i18n.getMessage("input_add_placeholder"));
$("#TasksLabel").text(chrome.i18n.getMessage("TasksLabel"));
$("#TemplatesLabel").text(chrome.i18n.getMessage("TemplatesLabel"));
$("#renameTaskContextMenuLabel").text(chrome.i18n.getMessage("renameTaskContextMenu"));
$("#duplicateTaskContextMenuLabel").text(chrome.i18n.getMessage("duplicateTaskContextMenu"));
$("#templateTaskContextMenuLabel").text(chrome.i18n.getMessage("templateTaskContextMenu"));
$("#deleteTaskContextMenuLabel").text(chrome.i18n.getMessage("deleteTaskContextMenu"));
$("#cloneTemplateContextMenuLabel").text(chrome.i18n.getMessage("cloneTemplateContextMenu"));
$("#deleteTemplateContextMenuLabel").text(chrome.i18n.getMessage("deleteTemplateContextMenu"));
}

0 comments on commit 805b4a4

Please sign in to comment.