1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00

JS-2699: Localise about.html

This commit is contained in:
Andrew Simachev 2023-07-28 14:43:35 +02:00
parent 46f43b3fd9
commit 0d4b75c367
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
4 changed files with 46 additions and 27 deletions

View file

@ -51,7 +51,7 @@ let csp = [
"media-src 'self' http://*:* https://*:* data: blob: file://*",
"style-src 'unsafe-inline' http://localhost:* file://*",
"font-src data: file://* http://localhost:*",
"connect-src http://localhost:* http://127.0.0.1:* ws://localhost:* https://*.anytype.io https://api.amplitude.com/ devtools://devtools data:",
"connect-src file://* http://localhost:* http://127.0.0.1:* ws://localhost:* https://*.anytype.io https://api.amplitude.com/ devtools://devtools data:",
"script-src-elem file: http://localhost:* https://sentry.io devtools://devtools 'unsafe-inline'",
"frame-src chrome-extension://react-developer-tools",
"worker-src 'self' 'unsafe-eval' blob: http://localhost:*",

View file

@ -1,30 +1,45 @@
// eslint-disable-next-line no-undef
var param = getParam();
var year = document.getElementById('year');
var closeButton = document.getElementById('close');
var version = document.getElementById('version');
var versionButton = document.getElementById('version-button');
var versionText = 'Version: ' + param.version;
$(() => {
var param = getParam();
var closeButton = $('#close');
var version = $('#version');
var versionButton = $('#version-button');
var versionText = 'Version: ' + param.version;
var lang = 'en-US';
document.title = 'Anytype';
year.innerText = new Date().getFullYear();
version.innerText = versionText;
try {
lang = JSON.parse(localStorage.interfaceLang);
} catch (e) {};
closeButton.addEventListener('click', e => {
e.preventDefault();
window.close();
});
document.title = 'Anytype';
version.text(versionText);
versionButton.addEventListener('click', e => {
e.preventDefault();
var handler = (e) => {
closeButton.on('click', e => {
e.preventDefault();
e.clipboardData.setData('text/plain', versionText);
document.removeEventListener('copy', handler, true);
};
window.close();
});
versionButton.on('click', e => {
e.preventDefault();
var handler = (e) => {
e.preventDefault();
e.clipboardData.setData('text/plain', versionText);
document.removeEventListener('copy', handler, true);
};
document.addEventListener('copy', handler, true);
document.execCommand('copy');
});
$.ajax({
url: `../../dist/lib/json/lang/${lang}.json`,
method: 'GET',
contentType: 'application/json',
success: (data) => {
$('#description').text(data.electronAboutDescription);
$('#copyright').text(data.electronAboutCopyright);
},
});
document.addEventListener('copy', handler, true);
document.execCommand('copy');
});

View file

@ -6,6 +6,7 @@
<title>Anytype</title>
<script src="./common.js" type="text/javascript"></script>
<script src="../../dist/js/jquery.js" type="text/javascript"></script>
<link rel="stylesheet" href="./about.css" />
</head>
<body>
@ -13,13 +14,13 @@
<img src="../img/icon.png" />
</div>
<h2 class="title">Anytype</h2>
<h3 class="description">Anytype is a next generation software that breaks down barriers between applications, gives back privacy and data ownership to users.</h3>
<h3 id="description" class="description">Anytype is a next generation software that breaks down barriers between applications, gives back privacy and data ownership to users.</h3>
<div id="version-button" class="version">
<span id="version"></span>
<div class="copy"></div>
</div>
<div class="copyright">Copyright (c) <span id="year" /> Anytype Inc.</div>
<div id="copyright" class="copyright"></div>
<div class="buttons">
<button id="close">Close</button>
</div>

View file

@ -89,6 +89,9 @@
"commonLCCollection": "collection",
"commonLCSet": "set",
"electronAboutDescription": "Anytype is a next generation software that breaks down barriers between applications, gives back privacy and data ownership to users.",
"electronAboutCopyright": "Made by Any — a Swiss association 🇨🇭",
"month1": "January",
"month2": "February",
"month3": "March",