Skip to content

Commit be0f64d

Browse files
committed
Add i18n keys that i18next-parse cannot handle automatically (#451)
1 parent fc250c9 commit be0f64d

File tree

4 files changed

+62
-4
lines changed

4 files changed

+62
-4
lines changed

frontend/src/explorer/explorer-event-controller.ts

+4
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ class ExplorerEventController {
315315
const endpoint = `${queryMode}:${landing ? 'user' : 'sample'}`;
316316
const collection = new FlatItemCollection(ldChannel.request(endpoint));
317317
const browsePanel = new SearchResultListPanel({
318+
// i18next.t('my_sources', 'My sources');
319+
// i18next.t('sample_sources', 'Sample sources');
320+
// i18next.t('my_items', 'My items');
321+
// i18next.t('sample_items', 'Sample items');
318322
title: i18next.t(i18nKey, title),
319323
collection,
320324
selectable: false,

frontend/src/i18n/en/translation.json

+21-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"heading": {
33
"annotations": "Annotations"
44
},
5+
"my_sources": "My sources",
6+
"sample_sources": "Sample sources",
7+
"my_items": "My items",
8+
"sample_items": "Sample items",
59
"feedback_submitted": "Feedback submitted",
610
"thanks_feedback": "Thank you very much for your feedback, it is highly appreciated!",
711
"close": "close",
@@ -69,8 +73,6 @@
6973
"contribute": "Contribute",
7074
"greeting": "Hello, {{username}}!",
7175
"landing-page": "Personal landing page",
72-
"my_sources": "My sources",
73-
"my_items": "My items",
7476
"feedback-tooltip": "Give us feedback on the interface",
7577
"log_out": "Log out",
7678
"not_found_alt": "404 Not Found",
@@ -137,6 +139,23 @@
137139
"registration_failed": "Registration failed. Please try again and if this error keeps occuring, contact the site administrator.",
138140
"view_operator_docs": "View documentation of search operators",
139141
"search_database": "Search our database",
142+
"filters": {
143+
"and": "AND",
144+
"or": "OR",
145+
"not": "NOT",
146+
"equals": "Is exactly",
147+
"less": "Is less than",
148+
"greater": "Is greater than",
149+
"isDefined": "Is defined",
150+
"startsWith": "Starts with",
151+
"endsWith": "Ends with",
152+
"contains": "Contains",
153+
"matchRegex": "Matches regular expression",
154+
"groupLogic": "apply logic",
155+
"groupFilters": "apply filter",
156+
"groupType": "expect type",
157+
"groupPredicates": "traverse predicate"
158+
},
140159
"semsearch-subtitle": "Find linked data items based on semantic features",
141160
"optional_label_placeholder": "optional label for reference",
142161
"semsearch-submit": "Search",

frontend/src/i18n/fr/translation.json

+21-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"heading": {
33
"annotations": "Annotations"
44
},
5+
"my_sources": "My sources",
6+
"sample_sources": "Sample sources",
7+
"my_items": "My items",
8+
"sample_items": "Sample items",
59
"feedback_submitted": "Feedback submitted",
610
"thanks_feedback": "Thank you very much for your feedback, it is highly appreciated!",
711
"close": "close",
@@ -69,8 +73,6 @@
6973
"contribute": "Contribute",
7074
"greeting": "Bonjour {{username}}!",
7175
"landing-page": "Personal landing page",
72-
"my_sources": "My sources",
73-
"my_items": "My items",
7476
"feedback-tooltip": "Give us feedback on the interface",
7577
"log_out": "Log out",
7678
"not_found_alt": "404 Not Found",
@@ -137,6 +139,23 @@
137139
"registration_failed": "Registration failed. Please try again and if this error keeps occuring, contact the site administrator.",
138140
"view_operator_docs": "View documentation of search operators",
139141
"search_database": "Search our database",
142+
"filters": {
143+
"and": "AND",
144+
"or": "OR",
145+
"not": "NOT",
146+
"equals": "Is exactly",
147+
"less": "Is less than",
148+
"greater": "Is greater than",
149+
"isDefined": "Is defined",
150+
"startsWith": "Starts with",
151+
"endsWith": "Ends with",
152+
"contains": "Contains",
153+
"matchRegex": "Matches regular expression",
154+
"groupLogic": "apply logic",
155+
"groupFilters": "apply filter",
156+
"groupType": "expect type",
157+
"groupPredicates": "traverse predicate"
158+
},
140159
"semsearch-subtitle": "Find linked data items based on semantic features",
141160
"optional_label_placeholder": "optional label for reference",
142161
"semsearch-submit": "Search",

frontend/src/semantic-search/dropdown-constants.ts

+16
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ import { xsd } from '../common-rdf/ns';
1313

1414
export const logic = new Collection([{
1515
id: 'logic:and',
16+
// i18next.t('filters.and', 'AND');
1617
label: 'AND',
1718
i18nKey: 'filters.and',
1819
}, {
1920
id: 'logic:or',
21+
// i18next.t('filters.or', 'OR');
2022
label: 'OR',
2123
i18nKey: 'filters.or',
2224
}, {
2325
id: 'logic:not',
26+
// i18next.t('filters.not', 'NOT');
2427
label: 'NOT',
2528
i18nKey: 'filters.not',
2629
}]);
@@ -33,41 +36,47 @@ export const filters = new Collection([{
3336
id: 'filter:equals',
3437
label: 'Is exactly',
3538
i18nKey: 'filters.equals',
39+
// i18next.t('filters.equals', 'Is exactly');
3640
uris: true,
3741
literals: true,
3842
operator: '=',
3943
}, {
4044
id: 'filter:less',
4145
label: 'Is less than',
4246
i18nKey: 'filters.less',
47+
// i18next.t('filters.less', 'Is less than');
4348
uris: false,
4449
literals: true,
4550
operator: '<',
4651
}, {
4752
id: 'filter:greater',
4853
label: 'Is greater than',
4954
i18nKey: 'filters.greater',
55+
// i18next.t('filters.greater', 'Is greater than');
5056
uris: false,
5157
literals: true,
5258
operator: '>',
5359
}, {
5460
id: 'filter:isIRI',
5561
label: 'Is defined',
5662
i18nKey: 'filters.isDefined',
63+
// i18next.t('filters.isDefined', 'Is defined');
5764
uris: true,
5865
literals: false,
5966
function: 'isIRI',
6067
}, {
6168
id: 'filter:isLiteral',
6269
label: 'Is defined',
6370
i18nKey: 'filters.isDefined',
71+
// i18next.t('filters.isDefined', 'Is defined');
6472
uris: false,
6573
literals: true,
6674
function: 'isLiteral',
6775
}, {
6876
id: 'filter:stringStarts',
6977
label: 'Starts with',
7078
i18nKey: 'filters.startsWith',
79+
// i18next.t('filters.startsWith', 'Starts with');
7180
uris: false,
7281
literals: true,
7382
restrict: [xsd.string],
@@ -76,6 +85,7 @@ export const filters = new Collection([{
7685
id: 'filter:stringEnds',
7786
label: 'Ends with',
7887
i18nKey: 'filters.endsWith',
88+
// i18next.t('filters.endsWith', 'Ends with');
7989
uris: false,
8090
literals: true,
8191
restrict: [xsd.string],
@@ -84,6 +94,7 @@ export const filters = new Collection([{
8494
id: 'filter:stringContains',
8595
label: 'Contains',
8696
i18nKey: 'filters.contains',
97+
// i18next.t('filters.contains', 'Contains');
8798
uris: false,
8899
literals: true,
89100
restrict: [xsd.string],
@@ -92,6 +103,7 @@ export const filters = new Collection([{
92103
id: 'filter:regex',
93104
label: 'Matches regular expression',
94105
i18nKey: 'filters.matchRegex',
106+
// i18next.t('filters.matchRegex', 'Matches regular expression');
95107
uris: false,
96108
literals: true,
97109
restrict: [xsd.string],
@@ -100,18 +112,22 @@ export const filters = new Collection([{
100112

101113
export const groupLabels = new Collection([{
102114
id: 'logic',
115+
// i18next.t('filters.groupLogic', 'apply logic');
103116
label: 'apply logic',
104117
i18nKey: 'filters.groupLogic',
105118
}, {
106119
id: 'filter',
120+
// i18next.t('filters.groupFilters', 'apply filter');
107121
label: 'apply filter',
108122
i18nKey: 'filters.groupFilters',
109123
}, {
110124
id: 'type',
125+
// i18next.t('filters.groupType', 'expect type');
111126
label: 'expect type',
112127
i18nKey: 'filters.groupType',
113128
}, {
114129
id: 'predicate',
130+
// i18next.t('filters.groupPredicates', 'traverse predicate');
115131
label: 'traverse predicate',
116132
i18nKey: 'filters.groupPredicates',
117133
}]);

0 commit comments

Comments
 (0)