Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization support + added Czech language #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# Ignore Mac DS_Store files
.DS_Store

# Ignore JetBrains IDEA files
.idea

# Ignore node modules
node_modules
34 changes: 34 additions & 0 deletions _locales/cs/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"appDesc": {
"message": "Chraňte svoje blízké před nedůvěryhodným obsahem.",
"description":"The description of the application, displayed in the web store."
},
"notification_warning": {
"message": "Zvyšte opatrnost! Tato stránka je zařazena<br/>v seznamu nedůvěryhodných webů.<br/>",
"description":"Warning text"
},
"notification_more": {
"message": "Více zjistíte na",
"description":"Find more at"
},
"notification_close": {
"message": "Zavřít upozornění",
"description":"Close warning"
},
"dialog_doubts": {
"message": "Máte pochybnosti<br />o důvěryhodnosti této<br />stránky?",
"description":"Doubts text"
},
"dialog_check": {
"message": "Nechte ji prověřit odbornou komisí!",
"description":"Check text"
},
"dialog_report": {
"message": "Nahlásit web",
"description":"Report web"
},
"dialog_about": {
"message": "Více o rozšíření",
"description":"Find more"
}
}
34 changes: 34 additions & 0 deletions _locales/sk/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"appDesc": {
"message": "Chráňte vašich blízkych pred nedôveryhodným obsahom.",
"description":"The description of the application, displayed in the web store."
},
"notification_warning": {
"message": "Zvýšte opatrnosť! Táto stránka je zaradená<br/>v zozname nedôveryhodných webov.<br/>",
"description":"Warning text"
},
"notification_more": {
"message": "Zistite viac na",
"description":"Find more at"
},
"notification_close": {
"message": "Zavrieť upozornenie",
"description":"Close warning"
},
"dialog_doubts": {
"message": "Máte pochybnosti<br />o dôveryhodnosti tejto<br />stránky?",
"description":"Doubts text"
},
"dialog_check": {
"message": "Nechajte ju preveriť odbornej komisii!",
"description":"Check text"
},
"dialog_report": {
"message": "Nahlásiť web",
"description":"Report web"
},
"dialog_about": {
"message": "Viac o rozšíreniu",
"description":"Find more"
}
}
1 change: 1 addition & 0 deletions assets/dialog/dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ footer, header, hgroup, menu, nav, section {
}
body {
line-height: 1;
overflow: hidden;
}
ol, ul {
list-style: none;
Expand Down
16 changes: 7 additions & 9 deletions assets/dialog/dialog.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
<!DOCTYPE html>
<html lang="sk">
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="dialog.css">
</head>
<body>
<div class="dialog_top">
<img class="dialog_icon" src="../../icons/icon48.png" />
<h1>Máte pochybnosti<br />
o dôveryhodnosti tejto<br />
stránky?
</h1>
<h1 id="dialog_doubts"></h1>
</div>
<div class="dialog_middle">
<h2>Nechajte ju preveriť odbornej komisii</h2><br />
<a href="" id="report" target="_blank" class="dialog_btn" tabIndex="-1">Nahlásiť web</a>
<h2 id="dialog_check"></h2><br />
<a href="" id="dialog_report" target="_blank" class="dialog_btn" tabIndex="-1"></a>
</div>
<div class="dialog_bottom">
<a href="" id="about" target="_blank" class="dialog_link" tabIndex="-1">Viac o plugine</a><br />
<a href="" id="websupport" target="_blank" class="dialog_partner" tabIndex="-1"><img src="../img/websupport.png" /></a> <a href="" id="konspiratori" target="_blank" class="dialog_partner" tabIndex="-1"><img src="../img/konspiratori.png" /></a>
<a href="" id="dialog_about" target="_blank" class="dialog_link" tabIndex="-1"></a><br />
<a href="" id="dialog_websupport" target="_blank" class="dialog_partner" tabIndex="-1"><img src="../img/websupport.png" /></a>
<a href="" id="dialog_konspiratori" target="_blank" class="dialog_partner" tabIndex="-1"><img src="../img/konspiratori.png" /></a>
</div>
<script src="dialog.js"></script>
</body>
Expand Down
22 changes: 18 additions & 4 deletions assets/dialog/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,21 @@ var link_report = "https://www.konspiratori.sk/nahlasenie-stranky.php";
var link_about = "https://www.websupport.sk/bullshit-detector";
var link_konspiratori = "https://www.konspiratori.sk/";
var link_websupport = "https://www.websupport.sk/";
document.getElementById("report").href = link_report;
document.getElementById("about").href = link_about;
document.getElementById("konspiratori").href = link_konspiratori;
document.getElementById("websupport").href = link_websupport;

function setLink(elementId, url) {
document.getElementById(elementId).href = url;
}

function setText(key) {
document.getElementById(key).innerHTML = chrome.i18n.getMessage(key);
}

setLink("dialog_report", link_report);
setLink("dialog_about", link_about);
setLink("dialog_konspiratori", link_konspiratori);
setLink("dialog_websupport", link_websupport);

setText("dialog_doubts");
setText("dialog_check");
setText("dialog_report");
setText("dialog_about");
4 changes: 3 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"manifest_version": 2,
"name": "Bullshit Detector",
"description": "__MSG_appDesc__",
"default_locale": "sk",

"version": "0.9",

"description": "Chráňte vašich blízkych pred nedôveryhodným obsahom",
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
Expand Down
13 changes: 9 additions & 4 deletions show_warning.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.