Skip to content

Commit

Permalink
Add i18n keys that i18next-parse cannot handle automatically (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed May 1, 2022
1 parent fc250c9 commit be0f64d
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 4 deletions.
4 changes: 4 additions & 0 deletions frontend/src/explorer/explorer-event-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ class ExplorerEventController {
const endpoint = `${queryMode}:${landing ? 'user' : 'sample'}`;
const collection = new FlatItemCollection(ldChannel.request(endpoint));
const browsePanel = new SearchResultListPanel({
// i18next.t('my_sources', 'My sources');
// i18next.t('sample_sources', 'Sample sources');
// i18next.t('my_items', 'My items');
// i18next.t('sample_items', 'Sample items');
title: i18next.t(i18nKey, title),
collection,
selectable: false,
Expand Down
23 changes: 21 additions & 2 deletions frontend/src/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"heading": {
"annotations": "Annotations"
},
"my_sources": "My sources",
"sample_sources": "Sample sources",
"my_items": "My items",
"sample_items": "Sample items",
"feedback_submitted": "Feedback submitted",
"thanks_feedback": "Thank you very much for your feedback, it is highly appreciated!",
"close": "close",
Expand Down Expand Up @@ -69,8 +73,6 @@
"contribute": "Contribute",
"greeting": "Hello, {{username}}!",
"landing-page": "Personal landing page",
"my_sources": "My sources",
"my_items": "My items",
"feedback-tooltip": "Give us feedback on the interface",
"log_out": "Log out",
"not_found_alt": "404 Not Found",
Expand Down Expand Up @@ -137,6 +139,23 @@
"registration_failed": "Registration failed. Please try again and if this error keeps occuring, contact the site administrator.",
"view_operator_docs": "View documentation of search operators",
"search_database": "Search our database",
"filters": {
"and": "AND",
"or": "OR",
"not": "NOT",
"equals": "Is exactly",
"less": "Is less than",
"greater": "Is greater than",
"isDefined": "Is defined",
"startsWith": "Starts with",
"endsWith": "Ends with",
"contains": "Contains",
"matchRegex": "Matches regular expression",
"groupLogic": "apply logic",
"groupFilters": "apply filter",
"groupType": "expect type",
"groupPredicates": "traverse predicate"
},
"semsearch-subtitle": "Find linked data items based on semantic features",
"optional_label_placeholder": "optional label for reference",
"semsearch-submit": "Search",
Expand Down
23 changes: 21 additions & 2 deletions frontend/src/i18n/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"heading": {
"annotations": "Annotations"
},
"my_sources": "My sources",
"sample_sources": "Sample sources",
"my_items": "My items",
"sample_items": "Sample items",
"feedback_submitted": "Feedback submitted",
"thanks_feedback": "Thank you very much for your feedback, it is highly appreciated!",
"close": "close",
Expand Down Expand Up @@ -69,8 +73,6 @@
"contribute": "Contribute",
"greeting": "Bonjour {{username}}!",
"landing-page": "Personal landing page",
"my_sources": "My sources",
"my_items": "My items",
"feedback-tooltip": "Give us feedback on the interface",
"log_out": "Log out",
"not_found_alt": "404 Not Found",
Expand Down Expand Up @@ -137,6 +139,23 @@
"registration_failed": "Registration failed. Please try again and if this error keeps occuring, contact the site administrator.",
"view_operator_docs": "View documentation of search operators",
"search_database": "Search our database",
"filters": {
"and": "AND",
"or": "OR",
"not": "NOT",
"equals": "Is exactly",
"less": "Is less than",
"greater": "Is greater than",
"isDefined": "Is defined",
"startsWith": "Starts with",
"endsWith": "Ends with",
"contains": "Contains",
"matchRegex": "Matches regular expression",
"groupLogic": "apply logic",
"groupFilters": "apply filter",
"groupType": "expect type",
"groupPredicates": "traverse predicate"
},
"semsearch-subtitle": "Find linked data items based on semantic features",
"optional_label_placeholder": "optional label for reference",
"semsearch-submit": "Search",
Expand Down
16 changes: 16 additions & 0 deletions frontend/src/semantic-search/dropdown-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ import { xsd } from '../common-rdf/ns';

export const logic = new Collection([{
id: 'logic:and',
// i18next.t('filters.and', 'AND');
label: 'AND',
i18nKey: 'filters.and',
}, {
id: 'logic:or',
// i18next.t('filters.or', 'OR');
label: 'OR',
i18nKey: 'filters.or',
}, {
id: 'logic:not',
// i18next.t('filters.not', 'NOT');
label: 'NOT',
i18nKey: 'filters.not',
}]);
Expand All @@ -33,41 +36,47 @@ export const filters = new Collection([{
id: 'filter:equals',
label: 'Is exactly',
i18nKey: 'filters.equals',
// i18next.t('filters.equals', 'Is exactly');
uris: true,
literals: true,
operator: '=',
}, {
id: 'filter:less',
label: 'Is less than',
i18nKey: 'filters.less',
// i18next.t('filters.less', 'Is less than');
uris: false,
literals: true,
operator: '<',
}, {
id: 'filter:greater',
label: 'Is greater than',
i18nKey: 'filters.greater',
// i18next.t('filters.greater', 'Is greater than');
uris: false,
literals: true,
operator: '>',
}, {
id: 'filter:isIRI',
label: 'Is defined',
i18nKey: 'filters.isDefined',
// i18next.t('filters.isDefined', 'Is defined');
uris: true,
literals: false,
function: 'isIRI',
}, {
id: 'filter:isLiteral',
label: 'Is defined',
i18nKey: 'filters.isDefined',
// i18next.t('filters.isDefined', 'Is defined');
uris: false,
literals: true,
function: 'isLiteral',
}, {
id: 'filter:stringStarts',
label: 'Starts with',
i18nKey: 'filters.startsWith',
// i18next.t('filters.startsWith', 'Starts with');
uris: false,
literals: true,
restrict: [xsd.string],
Expand All @@ -76,6 +85,7 @@ export const filters = new Collection([{
id: 'filter:stringEnds',
label: 'Ends with',
i18nKey: 'filters.endsWith',
// i18next.t('filters.endsWith', 'Ends with');
uris: false,
literals: true,
restrict: [xsd.string],
Expand All @@ -84,6 +94,7 @@ export const filters = new Collection([{
id: 'filter:stringContains',
label: 'Contains',
i18nKey: 'filters.contains',
// i18next.t('filters.contains', 'Contains');
uris: false,
literals: true,
restrict: [xsd.string],
Expand All @@ -92,6 +103,7 @@ export const filters = new Collection([{
id: 'filter:regex',
label: 'Matches regular expression',
i18nKey: 'filters.matchRegex',
// i18next.t('filters.matchRegex', 'Matches regular expression');
uris: false,
literals: true,
restrict: [xsd.string],
Expand All @@ -100,18 +112,22 @@ export const filters = new Collection([{

export const groupLabels = new Collection([{
id: 'logic',
// i18next.t('filters.groupLogic', 'apply logic');
label: 'apply logic',
i18nKey: 'filters.groupLogic',
}, {
id: 'filter',
// i18next.t('filters.groupFilters', 'apply filter');
label: 'apply filter',
i18nKey: 'filters.groupFilters',
}, {
id: 'type',
// i18next.t('filters.groupType', 'expect type');
label: 'expect type',
i18nKey: 'filters.groupType',
}, {
id: 'predicate',
// i18next.t('filters.groupPredicates', 'traverse predicate');
label: 'traverse predicate',
i18nKey: 'filters.groupPredicates',
}]);
Expand Down

0 comments on commit be0f64d

Please sign in to comment.