Commit 8a1b9024 authored by Duhoux Pierre-Louis's avatar Duhoux Pierre-Louis

Full i18n for application except debug logs and lab page which are developers only

parent 619348be
This diff is collapsed.
import browser from "webextension-polyfill";
import store from "../store";
import i18n from "./i18n";
/**
* Managa browser notifications
......@@ -44,7 +45,7 @@ class Notification {
url: urls[urls.indexOf(mg.lastChapterReadURL) - 1]
};
// Notification data added to letiables to be used by the old or by the new notification API.
let description = "... has new chapter(s) on " + mangaData.mirror + "! Click anywhere to open the next unread chapter.";
let description = i18n("notif_message", mangaData.mirror);
let title = mangaData.name;
let icon = browser.extension.getURL('/icons/icon_32.png');
let url = mangaData.url;
......
This diff is collapsed.
......@@ -4,6 +4,7 @@ import options from './options';
import mirrorImpl from './mirrorimpl'
import pageData from './pagedata'
import util from './util';
import i18n from '../amr/i18n';
class Reading {
consultManga() {
......@@ -79,10 +80,8 @@ class Reading {
this.waitForImages(where, mode, title);
}
async onLoadImage(img) {
console.log("Load image");
console.log(this);
console.log(img);
if ($(img).data("canvasId")) {
// This mode is no more used... was used when some websites did not display a scan to read but a canvas with parts of image on it...
let width, height;
let ancCan = $("#" + $(img).data("canvasId"));
......@@ -265,9 +264,6 @@ class Reading {
}
onErrorImage(img) {
console.log("Error image");
console.log(this);
console.log(img);
let reading = this;
$(img).css("margin-bottom", "50px");
$(img).css("margin-right", "10px");
......@@ -282,7 +278,7 @@ class Reading {
$("#" + $(img).data("divLoad")).css("display", "none");
//Create the reload button
let butReco = $("<a class='buttonAMR'>Try to reload</a>");
let butReco = $("<a class='buttonAMR'>" + i18n("content_read_reload") + "</a>");
butReco.css("display", "block");
butReco.css("max-width", "200px");
butReco.css("margin-left", "auto");
......
......@@ -41,7 +41,7 @@
"contextMenus",
"notifications"
],
"content_security_policy": "script-src 'self' http://localhost:8080/ https://ssl.google-analytics.com https://community.allmangasreader.com/ https://raw.github.com/ ; object-src 'self'",
"content_security_policy": "script-src 'self' https://localhost:8080/ https://ssl.google-analytics.com https://community.allmangasreader.com/ https://raw.github.com/ ; object-src 'self'",
"web_accessible_resources" : [
"icons/icon_32.png",
"icons/down.png",
......
......@@ -8,20 +8,20 @@
<!-- Category name and tooltip -->
<v-tooltip v-if="!staticCats" top content-class="icon-ttip" class="cat-name">
<span class="cat-name" slot="activator">{{cat.name}}</span>
<span v-if="cat.state==='include'">Mangas from category "{{cat.name}}" are <strong>included</strong> in the list</span>
<span v-if="cat.state==='exclude'">Mangas from category "{{cat.name}}" are <strong>excluded</strong> in the list</span>
<span v-if="!cat.state">Do not care about category "{{cat.name}}" to filter mangas</span>
<span v-if="cat.state==='include'">{{i18n("list_cat_include", cat.name)}}</span>
<span v-if="cat.state==='exclude'">{{i18n("list_cat_exclude", cat.name)}}</span>
<span v-if="!cat.state">{{i18n("list_cat_no", cat.name)}}</span>
</v-tooltip>
<span v-if="staticCats" class="cat-name">{{cat}}</span>
<!-- Icon only me -->
<v-tooltip v-if="!staticCats" top content-class="icon-ttip">
<v-icon class="cat-act" @click.stop="onlyMe(cat)" slot="activator">mdi-eye</v-icon>
<span>View only mangas from this category</span>
<span>{{i18n("list_cat_only")}}</span>
</v-tooltip>
<!-- Trash icon -->
<v-tooltip top content-class="icon-ttip">
<v-icon v-if="cat.type !== 'native'" class="cat-act" @click.stop="deleteCat(cat)" slot="activator">mdi-close</v-icon>
<span>Delete this category</span>
<span>{{i18n("list_cat_delete")}}</span>
</v-tooltip>
<!-- badge nb mangas -->
<span v-if="countUsed(cat) > 0" class="cat-badge grey darken-1">{{countUsed(cat)}}</span>
......@@ -31,12 +31,12 @@
@keyup.enter="addCategory()" />
<v-dialog v-model="deleteCatDialog" max-width="290">
<v-card>
<v-card-title class="headline">Delete category {{catToDelete.name}} ?</v-card-title>
<v-card-text>This category is associated to {{countUsed(catToDelete)}} mangas. This action will remove the category from these mangas too. Are you sure to do that ?</v-card-text>
<v-card-title class="headline">{{i18n("list_cat_delete", catToDelete.name)}}</v-card-title>
<v-card-text>{{i18n("list_cat_delete", countUsed(catToDelete))}}</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="red darken-1" flat @click.native="reallyDeleteCat()">Yes</v-btn>
<v-btn color="grey darken-1" flat @click.native="deleteCatDialog = false">No</v-btn>
<v-btn color="red darken-1" flat @click.native="reallyDeleteCat()">{{i18n("button_yes")}}</v-btn>
<v-btn color="grey darken-1" flat @click.native="deleteCatDialog = false">{{i18n("button_no")}}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
......
......@@ -21,8 +21,8 @@
<v-icon>mdi-calendar-clock</v-icon>
<span v-if="timeUpdated > 0">{{ timeUpdated }}</span>
</v-card>
<span v-if="timeUpdated === 0">Last chapter found today !</span>
<span v-else>Last chapter found {{ timeUpdated }} days ago</span>
<span v-if="timeUpdated === 0">{{i18n("list_calendar_today")}}</span>
<span v-else>{{i18n("list_calendar_days_found", timeUpdated)}}</span>
</v-tooltip>
</v-card>
</v-card>
......@@ -45,7 +45,7 @@
<!-- Reading progress -->
<v-tooltip top content-class="icon-ttip">
<v-progress-linear :value="progress" height="4" :color="color(-1)" slot="activator"></v-progress-linear>
<span>Progression : {{Math.floor(progress)}} %</span>
<span>{{ i18n("list_progress_reading", Math.floor(progress)) }}</span>
</v-tooltip>
</div>
<!-- Loading bar if chapters list is not loaded yet-->
......@@ -59,38 +59,38 @@
<!-- Mark as read -->
<v-tooltip v-if="hasNew" top content-class="icon-ttip">
<v-icon v-if="hasNew" slot="activator" @click="markAsRead()">mdi-eye</v-icon>
<span>Mark last published chapter as read</span>
<span>{{i18n("list_mg_act_read")}}</span>
</v-tooltip>
<!-- Empty icon if all read -->
<v-icon v-if="!hasNew" class="empty-icon"></v-icon>
<!-- Previous chapter -->
<v-tooltip v-if="posInChapList < manga.listChaps.length - 1" top content-class="icon-ttip">
<v-icon slot="activator" @click="play(-1)">mdi-chevron-left</v-icon>
<span>Read previous chapter</span>
<span>{{i18n("list_mg_act_prev")}}</span>
</v-tooltip>
<!-- Empty icon if no previous -->
<v-icon v-if="posInChapList === manga.listChaps.length - 1" class="empty-icon"></v-icon>
<!-- Current chapter play -->
<v-tooltip top content-class="icon-ttip">
<v-icon slot="activator" @click="play(0)">mdi-play</v-icon>
<span>Read current chapter</span>
<span>{{i18n("list_mg_act_cur")}}</span>
</v-tooltip>
<!-- Next chapter play -->
<v-tooltip v-if="posInChapList > 0" top content-class="icon-ttip">
<v-icon slot="activator" @click="play(1)">mdi-chevron-right</v-icon>
<span>Read next chapter</span>
<span>{{i18n("list_mg_act_next")}}</span>
</v-tooltip>
<!-- Empty icon if no next chapter -->
<v-icon v-if="posInChapList <= 0" class="empty-icon"></v-icon>
<!-- Last chapter play -->
<v-tooltip top content-class="icon-ttip">
<v-icon slot="activator" @click="play(Infinity)">mdi-page-last</v-icon>
<span>Read last published chapter</span>
<span>{{i18n("list_mg_act_latest")}}</span>
</v-tooltip>
<!-- Delete manga -->
<v-tooltip top content-class="icon-ttip">
<v-icon slot="activator" @click="deleteManga = true">mdi-delete</v-icon>
<span>Delete manga</span>
<span>{{i18n("list_mg_act_delete")}}</span>
</v-tooltip>
<!-- Display details panel -->
<v-icon v-if="isFirst" @click="$emit('details-click')">more_vert</v-icon>
......@@ -102,12 +102,12 @@
<v-dialog v-model="deleteManga" max-width="500px">
<v-card>
<v-card-title>
<span class="headline">Are you sure to delete {{manga.name}} on {{manga.mirror}} ?</span>
<span class="headline">{{i18n("list_mg_delete_question", manga.name, manga.mirror)}}</span>
</v-card-title>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click.native="deleteManga = false">No</v-btn>
<v-btn color="blue darken-1" flat @click.native="trash()">Yes</v-btn>
<v-btn color="blue darken-1" flat @click.native="deleteManga = false">{{i18("button_no")}}</v-btn>
<v-btn color="blue darken-1" flat @click.native="trash()">{{i18("button_yes")}}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
......
......@@ -21,7 +21,7 @@
<v-layout row>
<!-- Manage manga categories -->
<v-flex xs6 class="amr-categories">
<span>Categories : </span>
<span>{{i18n("list_details_cats")}} : </span>
<!-- Categories -->
<Categories
:categories="mangaCats"
......@@ -30,7 +30,7 @@
@delete-category="deleteCategory" />
<div class="det-sel-wrapper">
<select dark v-model="newCat" @change="addCategory()" :class="color(2)">
<option value="">Category to add</option>
<option value="">{{i18n("list_details_cats_select")}}</option>
<option v-for="(cat, key) of this.options.categoriesStates"
v-if="cat.type !== 'native'"
:key="key"
......@@ -42,16 +42,16 @@
</v-flex>
<!-- Manage manga bookmarks -->
<v-flex xs6 class="amr-bookmarks">
<span>Bookmarks : </span>
<span>{{i18n("list_details_books")}} : </span>
</v-flex>
</v-layout>
<!-- Actions buttons -->
<v-layout row text-xs-center>
<v-flex xs12 class="amr-actions">
<v-btn dark @click='' :color="color(0)" small>Search this manga elsewhere</v-btn>
<v-btn dark @click='resetManga()' :color="color(0)" small>Reset manga reading</v-btn>
<v-btn dark v-if="mangas[0].read === 0" @click='stopFollowingUpdates()' :color="color(0)" small>Stop following updates</v-btn>
<v-btn dark v-if="mangas[0].read === 1" @click='followUpdates()' :color="color(0)" small>Follow updates</v-btn>
<v-btn dark @click='true' :color="color(0)" small>{{i18n("list_details_act_search")}}</v-btn>
<v-btn dark @click='resetManga()' :color="color(0)" small>{{i18n("list_details_act_reset")}}</v-btn>
<v-btn dark v-if="mangas[0].read === 0" @click='stopFollowingUpdates()' :color="color(0)" small>{{i18n("list_details_act_stop_follow")}}</v-btn>
<v-btn dark v-if="mangas[0].read === 1" @click='followUpdates()' :color="color(0)" small>{{i18n("list_details_act_follow")}}</v-btn>
</v-flex>
</v-layout>
</v-container>
......
......@@ -10,11 +10,11 @@
<div class="amr-filters-container">
<v-tooltip top content-class="icon-ttip">
<v-icon slot="activator" @click="sort = 'az'" :class="'amr-filter ' + (sort === 'az' ? 'activated' : '')">mdi-sort-alphabetical</v-icon>
<span>Sort mangas in alphabetical order</span>
<span>{{i18n("list_sort_alpha")}}</span>
</v-tooltip>
<v-tooltip top content-class="icon-ttip">
<v-icon slot="activator" @click="sort = 'updates'" :class="'amr-filter ' + (sort === 'updates' ? 'activated' : '')">mdi-flash</v-icon>
<span>New chapters to read first !</span>
<span>{{i18n("list_sort_new")}}</span>
</v-tooltip>
</div>
<!-- Categories -->
......@@ -31,12 +31,10 @@
</div>
<!-- No mangas yet -->
<div v-if="!allMangas.length" class="amr-nomangas">
<p>
<strong>No manga in your list</strong>. Check the filters above or add mangas to the list.
To add a manga in the reading list, just go read a manga on a site supported by All Mangas Reader. Each manga you are reading is added or updated in the All Mangas Reader reading list. You can start reading a manga by searching one using the <v-icon>mdi-magnify</v-icon>.
<p :v-html="i18n('list_no_manga_message')">
</p>
<p>
<a @click.prevent="importSamples()">Start immediately by importing a few mangas we recommend !</a>
<a @click.prevent="importSamples()">{{ i18n("list_import_samples")}}</a>
</p>
</div>
</div>
......
......@@ -214,8 +214,8 @@
<v-select v-model="selectedLang" :items="distinctLangs"></v-select>
</v-flex>
<v-flex xs8>
<v-btn @click="deactivateAll()" color="primary" small>Deactivate all visible</v-btn>
<v-btn @click="activateAll()" color="primary" small>Activate all visible</v-btn>
<v-btn @click="deactivateAll()" color="primary" small>{{i18n('options_gen_deactivate_all')}}</v-btn>
<v-btn @click="activateAll()" color="primary" small>{{i18n('options_gen_activate_all')}}</v-btn>
</v-flex>
</v-layout>
<v-data-table
......@@ -242,7 +242,7 @@
{{ props.item.mirrorName }}
<!-- Badge with number of mangas read -->
<v-card v-if="nbMangas(props.item.mirrorName) > 0" color="primary" dark class="mirror-manga-info">
{{ nbMangas(props.item.mirrorName) }} mangas in list
{{ i18n('options_gen_mirrornbmangas', nbMangas(props.item.mirrorName)) }}
</v-card>
</td>
<td class="text-xs-right">
......@@ -259,28 +259,33 @@
<!-- Repositories -->
<div class="headline mt-4">{{ i18n("options_sup_repos") }}</div>
<div class="subtitle">{{i18n('options_sup_repos_desc')}}</div>
<v-layout row>
<v-flex xs12>
<v-dialog v-model="newRepositoryDialog" max-width="500px">
<v-btn color="primary" dark slot="activator" class="mb-2">New Repository</v-btn>
<v-btn color="primary" dark slot="activator" class="mb-2" small>{{i18n('options_gen_repos_dialog_title')}}</v-btn>
<v-card>
<v-card-title>
<span class="headline">Add new repository</span>
<span class="headline">{{i18n('options_gen_repos_dialog_desc')}}</span>
</v-card-title>
<v-card-text>
<v-container grid-list-md>
<v-layout wrap>
<v-flex xs12>
<v-text-field label="Repo URL" v-model="newRepo" class="normal-input-group"></v-text-field>
<v-text-field :label="i18n('options_gen_repos_input')" v-model="newRepo" class="normal-input-group"></v-text-field>
</v-flex>
</v-layout>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click.native="newRepositoryDialog = false">Cancel</v-btn>
<v-btn color="blue darken-1" flat @click.native="addRepository">Add</v-btn>
<v-btn color="blue darken-1" flat @click.native="newRepositoryDialog = false">{{i18n('button_cancel')}}</v-btn>
<v-btn color="blue darken-1" flat @click.native="addRepository">{{i18n('button_add')}}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-btn color="primary" dark class="mb-2" @click="goLab()" small>{{i18n('options_gen_laboratory')}}</v-btn>
</v-flex>
</v-layout>
<v-data-table
:items="impl_repositories"
hide-actions
......@@ -401,9 +406,9 @@ export default {
{ value: 2 * 60 * 1000, text: i18n("options_minutes", 2) }
],
headersSupportedWebsites: [
{ text: "Website name / number of mangas read", value: "name" },
{ text: "Language", value: "lang" },
{ text: "Activated", value: "activ" },
{ text: i18n("options_gen_mirrors_header_name"), value: "name" },
{ text: i18n("options_gen_mirrors_header_lang"), value: "lang" },
{ text: i18n("options_gen_mirrors_header_act"), value: "activ" },
],
newRepo: "",
newRepositoryDialog: false,
......@@ -425,7 +430,7 @@ export default {
},
distinctLangs() {
let dis = [];
dis.push({value: "", text: "All Languages"});
dis.push({value: "", text: i18n("options_gen_mirrors_filter_all")});
let dislangs = this.$store.state.mirrors.all.reduce((dm, mir) => {
mir.languages.split(",").forEach(lang => !dm.includes(lang) ? dm.push(lang) : dm)
return dm;
......@@ -563,6 +568,12 @@ export default {
_self.changeActivation(mir);
}
})
},
/**
* Opens lab
*/
goLab() {
browser.runtime.sendMessage({ action: "opentab", url: "/pages/lab/lab.html" });
}
}
};
......
......@@ -46,7 +46,7 @@
<v-btn icon @click.native="closeOptions()" dark>
<v-icon>close</v-icon>
</v-btn>
<v-toolbar-title>Settings</v-toolbar-title>
<v-toolbar-title>{{i18n("options_title")}}</v-toolbar-title>
</v-toolbar>
<Options />
</v-card>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment