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

Commit 101d465

Browse files
committed
source options translation
1 parent 136904a commit 101d465

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

src/lang/locale/en.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ export default {
1616
'toolbar_menu_aria_label': 'Open table options',
1717
'toolbar_menu_export_csv': 'Export CSV',
1818
'toolbar_menu_import_csv': 'Import CSV',
19+
/** SOURCE OPTIONS */
20+
'current_folder': "Current folder",
21+
"tag": "Tag",
22+
"outgoing_link": "Outgoing link",
23+
"incoming_link": "Incoming link",
24+
"query": "Dataview query",
1925
};

src/lang/locale/es.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ export default {
1616
'toolbar_menu_aria_label': 'Abrir opciones de tabla',
1717
'toolbar_menu_export_csv': 'Exportar CSV',
1818
'toolbar_menu_import_csv': 'Importar CSV',
19+
/** SOURCE OPTIONS */
20+
'current_folder': "Carpeta actual",
21+
"tag": "Etiqueta",
22+
"outgoing_link": "Enlace saliente",
23+
"incoming_link": "Enlace entrante",
24+
"query": "Consulta de Dataview",
1925
};

src/settings/handlers/source/SourceDropDownHandler.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { SourceDataTypes } from "helpers/Constants";
2+
import { t } from "lang/helpers";
23
import { AbstractSettingsHandler, SettingHandlerResponse } from "settings/handlers/AbstractSettingHandler";
34
import { add_dropdown } from "settings/SettingsComponents";
45

56
export class SourceDropDownHandler extends AbstractSettingsHandler {
67
settingTitle: string = 'Select the source of database data';
78
handle(settingHandlerResponse: SettingHandlerResponse): SettingHandlerResponse {
89
const { settingsManager, containerEl, view } = settingHandlerResponse;
10+
const sourceOptions: Record<string, string> = {};
11+
Object.entries(SourceDataTypes).forEach(([key, value]) => {
12+
sourceOptions[value] = t(value);
13+
});
914
const source_dropdown_promise = async (value: string): Promise<void> => {
1015
// update settings
1116
view.diskConfig.updateConfig({ source_data: value });
@@ -18,13 +23,7 @@ export class SourceDropDownHandler extends AbstractSettingsHandler {
1823
this.settingTitle,
1924
'Select from which source you want to get the data to be displayed in the table.',
2025
view.diskConfig.yaml.config.source_data,
21-
{
22-
current_folder: SourceDataTypes.CURRENT_FOLDER,
23-
tag: SourceDataTypes.TAG,
24-
outgoing_link: SourceDataTypes.OUTGOING_LINK,
25-
incoming_link: SourceDataTypes.INCOMING_LINK,
26-
query: SourceDataTypes.QUERY,
27-
},
26+
sourceOptions,
2827
source_dropdown_promise
2928
);
3029
return this.goNext(settingHandlerResponse);

0 commit comments

Comments
 (0)