Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 0dbe670

Browse files
committed
i18n: Translate about page
1 parent 10ec7d6 commit 0dbe670

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

src/public/app/services/i18n.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,25 @@ import library_loader from "./library_loader.js";
22

33
await library_loader.requireLibrary(library_loader.I18NEXT);
44

5+
i18next.init({
6+
lng: "en",
7+
debug: true,
8+
resources: {
9+
en: {
10+
translation: {
11+
about: {
12+
title: "About TriliumNext Notes",
13+
homepage: "Homepage:",
14+
app_version: "App version:",
15+
db_version: "DB version:",
16+
sync_version: "Sync version:",
17+
build_date: "Build date:",
18+
build_revision: "Build revision:",
19+
data_directory: "Data directory:"
20+
}
21+
}
22+
}
23+
}
24+
});
25+
526
export const t = i18next.t;

src/public/app/widgets/dialogs/about.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import server from "../../services/server.js";
22
import utils from "../../services/utils.js";
3+
import { t } from "../../services/i18n.js";
34
import BasicWidget from "../basic_widget.js";
45

56
const TPL = `
67
<div class="about-dialog modal fade mx-auto" tabindex="-1" role="dialog">
78
<div class="modal-dialog modal-lg" role="document">
89
<div class="modal-content">
910
<div class="modal-header">
10-
<h5 class="modal-title mr-auto">About TriliumNext Notes</h5>
11+
<h5 class="modal-title mr-auto">${t("about.title")}</h5>
1112
1213
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0;">
1314
<span aria-hidden="true">&times;</span>
@@ -16,33 +17,33 @@ const TPL = `
1617
<div class="modal-body">
1718
<table class="table table-borderless">
1819
<tr>
19-
<th>Homepage:</th>
20+
<th>${t("about.homepage")}</th>
2021
<td><a href="https://github.com/TriliumNext/Notes" class="external">https://github.com/TriliumNext/Notes</a></td>
2122
</tr>
2223
<tr>
23-
<th>App version:</th>
24+
<th>${t("about.app_version")}</th>
2425
<td class="app-version"></td>
2526
</tr>
2627
<tr>
27-
<th>DB version:</th>
28+
<th>${t("about.db_version")}</th>
2829
<td class="db-version"></td>
2930
</tr>
3031
<tr>
31-
<th>Sync version:</th>
32+
<th>${t("about.sync_version")}</th>
3233
<td class="sync-version"></td>
3334
</tr>
3435
<tr>
35-
<th>Build date:</th>
36+
<th>${t("about.build_date")}</th>
3637
<td class="build-date"></td>
3738
</tr>
3839
3940
<tr>
40-
<th>Build revision:</th>
41+
<th>${t("about.build_date")}</th>
4142
<td><a href="" class="build-revision external" target="_blank"></a></td>
4243
</tr>
4344
4445
<tr>
45-
<th>Data directory:</th>
46+
<th>${t("about.data_directory")}</th>
4647
<td class="data-directory"></td>
4748
</tr>
4849
</table>

0 commit comments

Comments
 (0)