Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
cb9b4c0
translate some dialogs
Nriver Jul 22, 2024
935e882
translate 5 more dialogs and refine some translation
Nriver Jul 23, 2024
a010659
Merge remote-tracking branch 'upstream-next/develop' into feature/i18n
Nriver Jul 24, 2024
5691554
add translation for `enter`
Nriver Jul 24, 2024
a8d6e5b
add translation for 6 more dialogs
Nriver Jul 24, 2024
da96344
add translation for the rest 7 dialogs
Nriver Jul 25, 2024
fa2d057
fix export note title
Nriver Jul 26, 2024
f3e09c3
add translation for attribute detail
Nriver Jul 26, 2024
92b0c7f
add translation for attribute editor
Nriver Jul 29, 2024
bcf892c
add translation for bulk action and script execute
Nriver Jul 29, 2024
738684c
add translation for bulk action of labels
Nriver Jul 29, 2024
71e69d3
fix text wrap in rename label
Nriver Jul 29, 2024
f7b5dbd
fix text wrap in about dialog
Nriver Jul 29, 2024
5043420
add translation for bulk action of notes
Nriver Jul 30, 2024
3ff3614
add translation for bulk action of relation
Nriver Jul 30, 2024
f116e52
add translation for bulk action titles
Nriver Jul 30, 2024
02ecdf5
add translation for buttons: attachments actions
Nriver Jul 31, 2024
b99510a
add translation for buttons: calendar
Nriver Jul 31, 2024
38a9ad6
add translation for buttons: close pane button
Nriver Jul 31, 2024
75e8a6c
add translation for buttons: create pane button
Nriver Jul 31, 2024
d84f438
add translation for buttons: edit button
Nriver Jul 31, 2024
8a0fec0
add translation for buttons: global menu
Nriver Aug 1, 2024
989a0d6
add translation for buttons: left pane toggle
Nriver Aug 1, 2024
355c416
add translation for buttons: move pane button
Nriver Aug 1, 2024
d21ca03
add translation for buttons: note actions
Nriver Aug 1, 2024
4081f44
add translation for buttons: onclick_button.js
Nriver Aug 1, 2024
9320a54
add translation for buttons: protected_session_status.js
Nriver Aug 1, 2024
e2d43b4
add translation for buttons: revisions_button.js
Nriver Aug 2, 2024
625e9ef
add translation for buttons: update_available.js
Nriver Aug 2, 2024
7fc3fda
add translation for note launcher button
Nriver Aug 2, 2024
156d3c4
fix miss deleted import
Nriver Aug 2, 2024
d93a943
fix broken button feature by over-translating
Nriver Aug 2, 2024
71c09b1
add translation for all floating buttons
Nriver Aug 5, 2024
971f52f
add translation for mobile_detail_menu.js
Nriver Aug 5, 2024
cfd33c8
add translation for ribbon widgets: basic_properties.js
Nriver Aug 5, 2024
97e127a
fix double curly braces
Nriver Aug 5, 2024
d47a5c4
add translation for ribbon widgets: book_properties.js
Nriver Aug 5, 2024
4270ab4
add translation for ribbon widgets: edited_notes.js
Nriver Aug 5, 2024
c2a8f4f
add translation for ribbon widgets: file_properties.js
Nriver Aug 5, 2024
e2aaa97
fix text wrap for file_properties.js
Nriver Aug 5, 2024
6743eb8
add translation for ribbon widgets: image_properties.js
Nriver Aug 5, 2024
931e319
add translation for ribbon widgets: inherited_attribute_list.js
Nriver Aug 5, 2024
bdc6a1f
add translation for ribbon widgets: note_info_widget.js
Nriver Aug 5, 2024
729715e
add translation for ribbon widgets: note_map.js
Nriver Aug 5, 2024
8358919
add translation for ribbon widgets: note_paths.js
Nriver Aug 5, 2024
2916182
add translation for 2 ribbon widgets
Nriver Aug 6, 2024
b7809a7
add translation for ribbon widgets: promoted_attributes.js
Nriver Aug 6, 2024
a8bb064
add translation for ribbon widgets: script_executor.js
Nriver Aug 6, 2024
74c4634
add translation for ribbon widgets: search_definition.js
Nriver Aug 6, 2024
9453ec4
add translation for the last ribbon widget
Nriver Aug 6, 2024
40f7465
add translation for all 9 search option files
Nriver Aug 7, 2024
2754bd7
add translation for 8 type widgets
Nriver Aug 7, 2024
8f60870
add translation for type widgets: relation_map.js
Nriver Aug 7, 2024
3d955ab
resolve code conflict in book.js
Nriver Aug 7, 2024
14bdd38
Merge remote-tracking branch 'upstream-next/develop' into feature/i18n
Nriver Aug 7, 2024
8dbafa3
revert change of i18n.js
Nriver Aug 7, 2024
01f99d7
Merge remote-tracking branch 'upstream-next/develop' into feature/i18n
Nriver Aug 8, 2024
9885abc
add translation for 2 type widgets
Nriver Aug 8, 2024
fcf4b57
add translation for backend_log.js and
Nriver Aug 8, 2024
febd1d5
add translation for font option
Nriver Aug 8, 2024
e8dc75d
improve font size UI under smaller screen
Nriver Aug 8, 2024
ec4b35e
add translation for all appearance options
Nriver Aug 8, 2024
b78ac44
Merge remote-tracking branch 'upstream-next/develop' into feature/i18n
Nriver Aug 9, 2024
38f19e2
add translation for all code note options
Nriver Aug 9, 2024
f6f5cc2
add translation for all image options
Nriver Aug 9, 2024
d6aa4d2
add translation for all other options
Nriver Aug 9, 2024
c9d0d33
add translation for all text note options
Nriver Aug 9, 2024
3a837cf
Merge remote-tracking branch 'origin/develop' into feature/i18n
eliandoran Aug 11, 2024
dcdbb09
update links in Chinese translation
Nriver Aug 12, 2024
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
4 changes: 2 additions & 2 deletions src/public/app/services/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ await i18next
debug: true,
backend: {
loadPath: `/${window.glob.assetPath}/translations/{{lng}}/{{ns}}.json`
}
}
});

export const t = i18next.t;
export const t = i18next.t;
240 changes: 113 additions & 127 deletions src/public/app/widgets/attribute_widgets/attribute_detail.js

Large diffs are not rendered by default.

23 changes: 12 additions & 11 deletions src/public/app/widgets/attribute_widgets/attribute_editor.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { t } from "../../services/i18n.js";
import NoteContextAwareWidget from "../note_context_aware_widget.js";
import noteAutocompleteService from "../../services/note_autocomplete.js";
import server from "../../services/server.js";
Expand All @@ -11,11 +12,11 @@ import attributeService from "../../services/attributes.js";
import linkService from "../../services/link.js";

const HELP_TEXT = `
<p>To add label, just type e.g. <code>#rock</code> or if you want to add also value then e.g. <code>#year = 2020</code></p>
<p>${t("attribute_editor.help_text_body1")}</p>

<p>For relation, type <code>~author = @</code> which should bring up an autocomplete where you can look up the desired note.</p>
<p>${t("attribute_editor.help_text_body2")}</p>

<p>Alternatively you can add label and relation using the <code>+</code> button on the right side.</p>`;
<p>${t("attribute_editor.help_text_body3")}</p>`;

const TPL = `
<div style="position: relative; padding-top: 10px; padding-bottom: 10px">
Expand Down Expand Up @@ -71,8 +72,8 @@ const TPL = `

<div class="attribute-list-editor" tabindex="200"></div>

<div class="bx bx-save save-attributes-button" title="Save attributes <enter>"></div>
<div class="bx bx-plus add-new-attribute-button" title="Add a new attribute"></div>
<div class="bx bx-save save-attributes-button" title="${t("attribute_editor.save_attributes")}"></div>
<div class="bx bx-plus add-new-attribute-button" title="${t("attribute_editor.add_a_new_attribute")}"></div>

<div class="attribute-errors" style="display: none;"></div>
</div>
Expand Down Expand Up @@ -217,13 +218,13 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget {
y: e.pageY,
orientation: 'left',
items: [
{title: `Add new label <kbd data-command="addNewLabel"></kbd>`, command: "addNewLabel", uiIcon: "bx bx-hash"},
{title: `Add new relation <kbd data-command="addNewRelation"></kbd>`, command: "addNewRelation", uiIcon: "bx bx-transfer"},
{title: "----"},
{title: "Add new label definition", command: "addNewLabelDefinition", uiIcon: "bx bx-empty"},
{title: "Add new relation definition", command: "addNewRelationDefinition", uiIcon: "bx bx-empty"},
{ title: t("attribute_editor.add_new_label"), command: "addNewLabel", uiIcon: "bx bx-hash" },
{ title: t("attribute_editor.add_new_relation"), command: "addNewRelation", uiIcon: "bx bx-transfer" },
{ title: "----" },
{ title: t("attribute_editor.add_new_label_definition"), command: "addNewLabelDefinition", uiIcon: "bx bx-empty" },
{ title: t("attribute_editor.add_new_relation_definition"), command: "addNewRelationDefinition", uiIcon: "bx bx-empty" },
],
selectMenuItemHandler: ({command}) => this.handleAddNewAttributeCommand(command)
selectMenuItemHandler: ({ command }) => this.handleAddNewAttributeCommand(command)
});
}

Expand Down
3 changes: 2 additions & 1 deletion src/public/app/widgets/bulk_actions/abstract_bulk_action.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { t } from "../../services/i18n.js";
import server from "../../services/server.js";
import ws from "../../services/ws.js";
import utils from "../../services/utils.js";
Expand All @@ -14,7 +15,7 @@ export default class AbstractBulkAction {

$rendered.find('.action-conf-del')
.on('click', () => this.deleteAction())
.attr('title', 'Remove this search action');
.attr('title', t('abstract_bulk_action.remove_this_search_action'));

utils.initHelpDropdown($rendered);

Expand Down
11 changes: 6 additions & 5 deletions src/public/app/widgets/bulk_actions/execute_script.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { t } from "../../services/i18n.js";
import SpacedUpdate from "../../services/spaced_update.js";
import AbstractBulkAction from "./abstract_bulk_action.js";

const TPL = `
<tr>
<td>
Execute script:
${t('execute_script.execute_script')}
</td>
<td>
<input type="text"
Expand All @@ -16,13 +17,13 @@ const TPL = `
<div class="dropdown help-dropdown">
<span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
<div class="dropdown-menu dropdown-menu-right p-4">
You can execute simple scripts on the matched notes.
${t('execute_script.help_text')}

For example to append a string to a note's title, use this small script:
${t('execute_script.example_1')}

<pre>note.title = note.title + ' - suffix';</pre>

More complex example would be deleting all matched note's attributes:
${t('execute_script.example_2')}

<pre>for (const attr of note.getOwnedAttributes) { attr.markAsDeleted(); }</pre>
</div>
Expand All @@ -35,7 +36,7 @@ const TPL = `

export default class ExecuteScriptBulkAction extends AbstractBulkAction {
static get actionName() { return "executeScript"; }
static get actionTitle() { return "Execute script"; }
static get actionTitle() { return t("execute_script.execute_script"); }

doRender() {
const $action = $(TPL);
Expand Down
21 changes: 11 additions & 10 deletions src/public/app/widgets/bulk_actions/label/add_label.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
import { t } from "../../../services/i18n.js";
import SpacedUpdate from "../../../services/spaced_update.js";
import AbstractBulkAction from "../abstract_bulk_action.js";

const TPL = `
<tr>
<td colspan="2">
<div style="display: flex; align-items: center">
<div style="margin-right: 10px;" class="text-nowrap">Add label</div>
<div style="margin-right: 10px;" class="text-nowrap">${t("add_label.add_label")}</div>

<input type="text"
class="form-control label-name"
placeholder="label name"
placeholder="${t("add_label.label_name_placeholder")}"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
title="${t("add_label.label_name_title")}"/>

<div style="margin-right: 10px; margin-left: 10px;" class="text-nowrap">to value</div>
<div style="margin-right: 10px; margin-left: 10px;" class="text-nowrap">${t("add_label.to_value")}</div>

<input type="text" class="form-control label-value" placeholder="new value"/>
<input type="text" class="form-control label-value" placeholder="${t("add_label.new_value_placeholder")}"/>
</div>
</td>
<td class="button-column">
<div class="dropdown help-dropdown">
<span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
<div class="dropdown-menu dropdown-menu-right p-4">
<p>On all matched notes:</p>
<p>${t("add_label.help_text")}</p>

<ul>
<li>create given label if note doesn't have one yet</li>
<li>or change value of the existing label</li>
<li>${t("add_label.help_text_item1")}</li>
<li>${t("add_label.help_text_item2")}</li>
</ul>

<p>You can also call this method without value, in such case label will be assigned to the note without value.</p>
<p>${t("add_label.help_text_note")}</p>
</div>
</div>

Expand All @@ -39,7 +40,7 @@ const TPL = `

export default class AddLabelBulkAction extends AbstractBulkAction {
static get actionName() { return "addLabel"; }
static get actionTitle() { return "Add label"; }
static get actionTitle() { return t("add_label.add_label"); }

doRender() {
const $action = $(TPL);
Expand Down
9 changes: 5 additions & 4 deletions src/public/app/widgets/bulk_actions/label/delete_label.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { t } from "../../../services/i18n.js";
import SpacedUpdate from "../../../services/spaced_update.js";
import AbstractBulkAction from "../abstract_bulk_action.js";

const TPL = `
<tr>
<td>
Delete label:
${t("delete_label.delete_label")}
</td>
<td>
<input type="text"
class="form-control label-name"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."
placeholder="label name"/>
title="${t("delete_label.label_name_title")}"
placeholder="${t("delete_label.label_name_placeholder")}"/>
</td>
<td class="button-column">
<span class="bx bx-x icon-action action-conf-del"></span>
Expand All @@ -20,7 +21,7 @@ const TPL = `

export default class DeleteLabelBulkAction extends AbstractBulkAction {
static get actionName() { return "deleteLabel"; }
static get actionTitle() { return "Delete label"; }
static get actionTitle() { return t("delete_label.delete_label"); }

doRender() {
const $action = $(TPL);
Expand Down
15 changes: 8 additions & 7 deletions src/public/app/widgets/bulk_actions/label/rename_label.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import { t } from "../../../services/i18n.js";
import SpacedUpdate from "../../../services/spaced_update.js";
import AbstractBulkAction from "../abstract_bulk_action.js";

const TPL = `
<tr>
<td colspan="2">
<div style="display: flex; align-items: center">
<div style="margin-right: 10px; flex-shrink: 0;">Rename label from:</div>
<div style="margin-right: 10px; flex-shrink: 0;">${t("rename_label.rename_label_from")}</div>

<input type="text"
class="form-control old-label-name"
placeholder="old name"
placeholder="${t("rename_label.old_name_placeholder")}"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
title="${t("rename_label.name_title")}"/>

<div style="margin-right: 10px; margin-left: 10px;">To:</div>
<div style="margin-right: 10px; margin-left: 10px;" class="text-nowrap">${t("rename_label.to")}</div>

<input type="text"
class="form-control new-label-name"
placeholder="new name"
placeholder="${t("rename_label.new_name_placeholder")}"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
title="${t("rename_label.name_title")}"/>
</div>
</td>
<td class="button-column">
Expand All @@ -29,7 +30,7 @@ const TPL = `

export default class RenameLabelBulkAction extends AbstractBulkAction {
static get actionName() { return "renameLabel"; }
static get actionTitle() { return "Rename label"; }
static get actionTitle() { return t("rename_label.rename_label"); }

doRender() {
const $action = $(TPL);
Expand Down
17 changes: 9 additions & 8 deletions src/public/app/widgets/bulk_actions/label/update_label_value.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
import { t } from "../../../services/i18n.js";
import SpacedUpdate from "../../../services/spaced_update.js";
import AbstractBulkAction from "../abstract_bulk_action.js";

const TPL = `
<tr>
<td colspan="2">
<div style="display: flex; align-items: center">
<div style="margin-right: 10px;" class="text-nowrap">Update label value</div>
<div style="margin-right: 10px;" class="text-nowrap">${t("update_label_value.update_label_value")}</div>

<input type="text"
class="form-control label-name"
placeholder="label name"
placeholder="${t("update_label_value.label_name_placeholder")}"
pattern="[\\p{L}\\p{N}_:]+"
title="Alphanumeric characters, underscore and colon are allowed characters."/>
title="${t("update_label_value.label_name_title")}"/>

<div style="margin-right: 10px; margin-left: 10px;" class="text-nowrap">to value</div>
<div style="margin-right: 10px; margin-left: 10px;" class="text-nowrap">${t("update_label_value.to_value")}</div>

<input type="text" class="form-control label-value" placeholder="new value"/>
<input type="text" class="form-control label-value" placeholder="${t("update_label_value.new_value_placeholder")}"/>
</div>
</td>
<td class="button-column">
<div class="dropdown help-dropdown">
<span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
<div class="dropdown-menu dropdown-menu-right p-4">
<p>On all matched notes, change value of the existing label.</p>
<p>${t("update_label_value.help_text")}</p>

<p>You can also call this method without value, in such case label will be assigned to the note without value.</p>
<p>${t("update_label_value.help_text_note")}</p>
</div>
</div>

Expand All @@ -34,7 +35,7 @@ const TPL = `

export default class UpdateLabelValueBulkAction extends AbstractBulkAction {
static get actionName() { return "updateLabelValue"; }
static get actionTitle() { return "Update label value"; }
static get actionTitle() { return t("update_label_value.update_label_value"); }

doRender() {
const $action = $(TPL);
Expand Down
11 changes: 6 additions & 5 deletions src/public/app/widgets/bulk_actions/note/delete_note.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import { t } from "../../../services/i18n.js";
import AbstractBulkAction from "../abstract_bulk_action.js";

const TPL = `
<tr>
<td colspan="2">
<span class="bx bx-trash"></span>

Delete matched notes
${t("delete_note.delete_matched_notes")}
</td>
<td class="button-column">
<div class="dropdown help-dropdown">
<span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
<div class="dropdown-menu dropdown-menu-right p-4">
<p>This will delete matched notes.</p>
<p>${t("delete_note.delete_matched_notes_description")}</p>

<p>After the deletion, it's possible to undelete them from <span class="bx bx-history"></span> Recent Notes dialog.</p>
<p>${t("delete_note.undelete_notes_instruction")}</p>

<p>To erase notes permanently, you can go after the deletion to the Option -> Other and click the "Erase deleted notes now" button.</p>
<p>${t("delete_note.erase_notes_instruction")}</p>
</div>
</div>

Expand All @@ -25,7 +26,7 @@ const TPL = `

export default class DeleteNoteBulkAction extends AbstractBulkAction {
static get actionName() { return "deleteNote"; }
static get actionTitle() { return "Delete note"; }
static get actionTitle() { return t("delete_note.delete_note"); }

doRender() {
return $(TPL);
Expand Down
9 changes: 4 additions & 5 deletions src/public/app/widgets/bulk_actions/note/delete_revisions.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
import { t } from "../../../services/i18n.js";
import AbstractBulkAction from "../abstract_bulk_action.js";

const TPL = `
<tr>
<td colspan="2">
<span class="bx bx-trash"></span>

Delete note revisions
${t('delete_revisions.delete_note_revisions')}
</td>
<td class="button-column">
<div class="dropdown help-dropdown">
<span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
<div class="dropdown-menu dropdown-menu-right p-4">
All past note revisions of matched notes will be deleted. Note itself will be fully preserved. In other terms, note's history will be removed.
${t('delete_revisions.all_past_note_revisions')}
</div>
</div>

<span class="bx bx-x icon-action action-conf-del"></span>
</td>
</tr>`;

export default class DeleteRevisionsBulkAction extends AbstractBulkAction {
static get actionName() { return "deleteRevisions"; }
static get actionTitle() { return "Delete note revisions"; }
static get actionTitle() { return t('delete_revisions.delete_note_revisions'); }

doRender() {
return $(TPL);
Expand Down
Loading