client: Translate shared info

This commit is contained in:
Elian Doran 2024-09-08 21:19:13 +03:00
parent f26a04216a
commit 8074245758
No known key found for this signature in database
3 changed files with 14 additions and 3 deletions

View File

@ -1,6 +1,7 @@
import NoteContextAwareWidget from "./note_context_aware_widget.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js";
import options from "../services/options.js"; import options from "../services/options.js";
import attributeService from "../services/attributes.js"; import attributeService from "../services/attributes.js";
import { t } from "../services/i18n.js";
const TPL = ` const TPL = `
<div class="shared-info-widget alert alert-warning"> <div class="shared-info-widget alert alert-warning">
@ -13,7 +14,7 @@ const TPL = `
} }
</style> </style>
<span class="shared-text"></span> <a class="shared-link external"></a>. For help visit <a href="https://triliumnext.github.io/Docs/Wiki/sharing.html">wiki</a>. <span class="shared-text"></span> <a class="shared-link external"></a>. ${t("shared_info.help_link")}
</div>`; </div>`;
export default class SharedInfoWidget extends NoteContextAwareWidget { export default class SharedInfoWidget extends NoteContextAwareWidget {
@ -36,7 +37,7 @@ export default class SharedInfoWidget extends NoteContextAwareWidget {
if (syncServerHost) { if (syncServerHost) {
link = `${syncServerHost}/share/${shareId}`; link = `${syncServerHost}/share/${shareId}`;
this.$sharedText.text("This note is shared publicly on"); this.$sharedText.text(t("shared_info.shared_publicly"));
} }
else { else {
let host = location.host; let host = location.host;
@ -47,7 +48,7 @@ export default class SharedInfoWidget extends NoteContextAwareWidget {
} }
link = `${location.protocol}//${host}${location.pathname}share/${shareId}`; link = `${location.protocol}//${host}${location.pathname}share/${shareId}`;
this.$sharedText.text("This note is shared locally on"); this.$sharedText.text(t("shared_info.shared_locally"));
} }
this.$sharedLink.attr("href", link).text(link); this.$sharedLink.attr("href", link).text(link);

View File

@ -1276,5 +1276,10 @@
"export": "Export", "export": "Export",
"import-into-note": "Import into note", "import-into-note": "Import into note",
"apply-bulk-actions": "Apply bulk actions" "apply-bulk-actions": "Apply bulk actions"
},
"shared_info": {
"shared_publicly": "This note is shared publicly on",
"shared_locally": "This note is shared locally on",
"help_link": "For help visit <a href=\"https://triliumnext.github.io/Docs/Wiki/sharing.html\">wiki</a>."
} }
} }

View File

@ -1276,5 +1276,10 @@
"search-in-subtree": "Caută în ierarhie", "search-in-subtree": "Caută în ierarhie",
"sort-by": "Ordonare după...", "sort-by": "Ordonare după...",
"unprotect-subtree": "Deprotejează ierarhia" "unprotect-subtree": "Deprotejează ierarhia"
},
"shared_info": {
"help_link": "Pentru informații vizitați <a href=\"https://triliumnext.github.io/Docs/Wiki/sharing.html\">wiki-ul</a>.",
"shared_locally": "Această notiță este partajată local la",
"shared_publicly": "Această notiță este partajată public la"
} }
} }