Skip to content

Commit

Permalink
Replace _ by - in i18n keys (#451)
Browse files Browse the repository at this point in the history
The underscore is the context and number separator in i18next. At the
time of writing we are not using this anywhere yet. To avoid confusion,
use a dash as a word separator.
  • Loading branch information
jgonggrijp committed May 1, 2022
1 parent 6b665cb commit 4a10968
Show file tree
Hide file tree
Showing 36 changed files with 280 additions and 280 deletions.
10 changes: 5 additions & 5 deletions frontend/src/explorer/explorer-event-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,14 @@ class ExplorerEventController {
landing = false;
}
const title = `${landing ? 'My' : 'Sample'} ${queryMode}`;
const i18nKey = title.toLowerCase().replace(' ', '_');
const i18nKey = title.toLowerCase().replace(' ', '-');
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');
// 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
10 changes: 5 additions & 5 deletions frontend/src/feedback/feedback-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<form class="box register-form is-narrow-modal-form">
{{#if wasSentSuccessfully}}
<header>
<h3 class="title is-3 page-header">{{#i18n 'feedback_submitted'}}Feedback submitted{{/i18n}}</h3>
<h3 class="title is-3 page-header">{{#i18n 'feedback-submitted'}}Feedback submitted{{/i18n}}</h3>
</header>
<div class="field">
<p>{{#i18n 'thanks_feedback'}}Thank you very much for your feedback, it is highly appreciated!{{/i18n}}</p>
<p>{{#i18n 'thanks-feedback'}}Thank you very much for your feedback, it is highly appreciated!{{/i18n}}</p>
</div>
<div class="field is-grouped">
<div class="control">
Expand All @@ -25,7 +25,7 @@
class="input"
type="text"
name="title"
placeholder="{{#i18n 'about_readit'}}About READ-IT{{/i18n}}"
placeholder="{{#i18n 'about-readit'}}About READ-IT{{/i18n}}"
>
</div>
</div>
Expand All @@ -36,14 +36,14 @@
<textarea
name="feedback"
class="textarea"
placeholder="{{#i18n 'feedback_placeholder'}}e.g. I love READ-IT!{{/i18n}}"
placeholder="{{#i18n 'feedback-placeholder'}}e.g. I love READ-IT!{{/i18n}}"
></textarea>
</div>
</div>

{{#if hasError}}
<div class="field form-feedback-bar has-background-danger has-text-white">
<p class="help">{{#i18n 'feedback_failed'}}Feedback submission failed. Please try again and if this error keeps occuring, contact the
<p class="help">{{#i18n 'feedback-failed'}}Feedback submission failed. Please try again and if this error keeps occuring, contact the
site administrator.{{/i18n}}</p>
</div>
{{/if}}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/footer/footer-template.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<figure class="footer-dh">
<p>{{#i18n 'developed_by'}}Developed by{{/i18n}}</p>
<p>{{#i18n 'developed-by'}}Developed by{{/i18n}}</p>
<a href="https://dig.hum.uu.nl" target="_blank"><img class="dhlab"
src="{{static 'image/dighum-logo-blue.svg'}}"></a>
<div class="footer-project is-pulled-right">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/forms/ontology-class-picker-template.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="dropdown">
<div class="dropdown-trigger">
<button type=button class="button" aria-haspopup="true" aria-controls="dropdown-menu">
<span class="dropdown-label">{{#i18n 'define_category'}}This is a{{/i18n}}
<span class="dropdown-label">{{#i18n 'define-category'}}This is a{{/i18n}}
<span class="dropdown-label-tag">...</span>
</span>
<span class="icon is-small">
Expand Down
182 changes: 91 additions & 91 deletions frontend/src/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
"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!",
"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",
"feedback": "Feedback",
"subject": "Subject",
"about_readit": "About READ-IT",
"feedback_placeholder": "e.g. I love READ-IT!",
"feedback_failed": "Feedback submission failed. Please try again and if this error keeps occuring, contact the\n site administrator.",
"about-readit": "About READ-IT",
"feedback-placeholder": "e.g. I love READ-IT!",
"feedback-failed": "Feedback submission failed. Please try again and if this error keeps occuring, contact the\n site administrator.",
"submit": "Submit",
"developed_by": "Developed by",
"developed-by": "Developed by",
"add": "Add",
"define_category": "This is a",
"define-category": "This is a",
"remove": "Remove",
"filterHierarchy": {
"mine": "by me",
Expand All @@ -27,118 +27,118 @@
"semantic": "human",
"nlp": "automated"
},
"permitted_types_before_list": "This property permits",
"current_type": "Current type:",
"permitted-types-before-list": "This property permits",
"current-type": "Current type:",
"typeHints": {
"integer": "Include extra leading zeros to force interpretation as an integer type.",
"base64Binary": "Include internal whitespace to force interpretation as base 64 binary data.",
"gYear": "Include time zone information (such as a final &ldquo;Z&rdquo;) to force interpretation as a Gregorian year.",
"string": "Start with a space to force interpretation as text or a derived string type."
},
"all_types_permitted": "This property permits any simple type.",
"no_type_matched": "This value does not match the permitted type(s).",
"all-types-permitted": "This property permits any simple type.",
"no-type-matched": "This value does not match the permitted type(s).",
"name": "Name",
"value": "Value",
"item_metadata": "Item metadata",
"item-metadata": "Item metadata",
"interpunction": {
"colon": ":",
"paragraph_ellipsis": "(...)"
"paragraph-ellipsis": "(...)"
},
"sources": "Sources",
"sources_tally": "You uploaded {{userSources}} of {{totalSources}} sources.",
"view_sources": "View your sources",
"explore_sources": "Explore sources",
"sources-tally": "You uploaded {{userSources}} of {{totalSources}} sources.",
"view-sources": "View your sources",
"explore-sources": "Explore sources",
"items": "Items",
"items_tally": "You created {{userItems}} of {{totalItems}} items.",
"view_items": "View your items",
"explore_items": "Explore items",
"items-tally": "You created {{userItems}} of {{totalItems}} items.",
"view-items": "View your items",
"explore-items": "Explore items",
"username": "Username",
"password": "Password",
"login_failed": "That didn't work. Please try again.",
"login-failed": "That didn't work. Please try again.",
"login": "Login",
"cancel": "Cancel",
"no_account": "Don't have an account?",
"sign_up": "Sign up!",
"main_navigation": "main navigation",
"no-account": "Don't have an account?",
"sign-up": "Sign up!",
"main-navigation": "main navigation",
"menu": "menu",
"about_tooltip": "Find out more about the READ-IT project",
"about-tooltip": "Find out more about the READ-IT project",
"about": "About",
"search_tooltip": "Search reading experiences and annotations",
"search-tooltip": "Search reading experiences and annotations",
"search": "Search",
"explore_tooltip": "Get a random selection of reading experiences and annotations",
"explore-tooltip": "Get a random selection of reading experiences and annotations",
"explore": "Explore",
"upload_tooltip": "Upload reading testimonies for annotation",
"upload-tooltip": "Upload reading testimonies for annotation",
"upload": "Upload",
"contribute_tooltip": "Find out how to contribute to READ-IT",
"contribute-tooltip": "Find out how to contribute to READ-IT",
"contribute": "Contribute",
"greeting": "Hello, {{username}}!",
"landing-page": "Personal landing page",
"feedback-tooltip": "Give us feedback on the interface",
"log_out": "Log out",
"not_found_alt": "404 Not Found",
"not_found_text": "Oops, this page doesn't seem to exist.\n You can <a onclick=\"history.back()\">go back</a>,\n visit <a href=\"/landing\">Landing</a> or <a href=\"/search\">Search</a>,\n or report a problem to the maintainers.",
"log-out": "Log out",
"not-found-alt": "404 Not Found",
"not-found-text": "Oops, this page doesn't seem to exist.\n You can <a onclick=\"history.back()\">go back</a>,\n visit <a href=\"/landing\">Landing</a> or <a href=\"/search\">Search</a>,\n or report a problem to the maintainers.",
"pagination": "pagination",
"to_first_page": "Go to page 1",
"to_last_page": "Go to last page",
"annotations_title": "Annotations",
"to-first-page": "Go to page 1",
"to-last-page": "Go to last page",
"annotations-title": "Annotations",
"filter": "Filter",
"export_annotations": "Export annotations",
"edit_annotation": "Edit Annotation",
"annotation_info": "(Find more info on what and how to annotate in\n <a class=\"is-link\" href=\"http://dhstatic.hum.uu.nl/readit/AnnotationGuide.pdf\" target=\"_blank\"> the\n Annotation Guide</a>",
"title_category": "Category",
"category_choice": "Choose a category before saving.",
"needs_verification": "Needs verification",
"label_choice": "Which one?",
"new_item_create": "Create new",
"edit_properties": "Edit properties",
"xsd_available_types_before_link": "See",
"xsd_available_types_link": "the XML Schema recommendation",
"xsd_available_types_after_link": "for an overview of the available types and their lexical representations.",
"preferred_label_choice": "Choose a preferred label before saving.",
"export-annotations": "Export annotations",
"edit-annotation": "Edit Annotation",
"annotation-info": "(Find more info on what and how to annotate in\n <a class=\"is-link\" href=\"http://dhstatic.hum.uu.nl/readit/AnnotationGuide.pdf\" target=\"_blank\"> the\n Annotation Guide</a>",
"title-category": "Category",
"category-choice": "Choose a category before saving.",
"needs-verification": "Needs verification",
"label-choice": "Which one?",
"new-item-create": "Create new",
"edit-properties": "Edit properties",
"xsd-available-types-before-link": "See",
"xsd-available-types-link": "the XML Schema recommendation",
"xsd-available-types-after-link": "for an overview of the available types and their lexical representations.",
"preferred-label-choice": "Choose a preferred label before saving.",
"save": "Save",
"delete": "Delete",
"annotation": "Annotation",
"identified_as": "identified as",
"identified-as": "identified as",
"item": "item",
"annotation_verification": "This annotation needs to be verified.",
"item_properties": "Item properties",
"related_items_title": "Related items",
"open_related": "Open related items",
"other_annotations_title": "Other annotations",
"open_annotations": "Open annotations",
"external_resources_title": "External resources",
"open_external": "Open external resources",
"annotation-verification": "This annotation needs to be verified.",
"item-properties": "Item properties",
"related-items-title": "Related items",
"open-related": "Open related items",
"other-annotations-title": "Other annotations",
"open-annotations": "Open annotations",
"external-resources-title": "External resources",
"open-external": "Open external resources",
"edit": "Edit",
"new": "New",
"annotation_metadata": "Annotation metadata",
"edit_external_resources": "Edit external resources",
"for_item": "For item",
"edit_related_items": "Edit related items",
"no_details": "No further details",
"search_results": "Search Results",
"source_title_many": "Sources",
"no_search_results": "No search results.",
"source_metadata_title": "Source metadata",
"properties_title": "Properties",
"delete_source": "Delete source",
"source_delete_confirm": "\nAre you sure you want to delete this source?\nIf you delete this source, all its annotation will be deleted as well, including any annotations that other users may have made.\nThis cannot be undone.\n",
"confirmation_complete": "Confirmation complete",
"sign_up_thanks_before_link": "Thank you for signing up. You can now",
"sign_up_thanks_link": "login",
"sign_up_thanks_after_link": ".",
"confirmation_failed": "Confirmation failed",
"token_expiration": "This is probably due to token expiration.",
"try_confirm_again": "Please try again and if this error keeps occuring, contact the site administrator.",
"registration_finished": "Registration finished succesfully!",
"activate_account": "Please activate your account via the link in the mail we just sent you.",
"find_email": "Make sure to check your 'Spam' folder if you can't find the email in your inbox.",
"close_window": "You can now close this window.",
"annotation-metadata": "Annotation metadata",
"edit-external-resources": "Edit external resources",
"for-item": "For item",
"edit-related-items": "Edit related items",
"no-details": "No further details",
"search-results": "Search Results",
"source-title-many": "Sources",
"no-search-results": "No search results.",
"source-metadata-title": "Source metadata",
"properties-title": "Properties",
"delete-source": "Delete source",
"source-delete-confirm": "\nAre you sure you want to delete this source?\nIf you delete this source, all its annotation will be deleted as well, including any annotations that other users may have made.\nThis cannot be undone.\n",
"confirmation-complete": "Confirmation complete",
"sign-up-thanks-before-link": "Thank you for signing up. You can now",
"sign-up-thanks-link": "login",
"sign-up-thanks-after-link": ".",
"confirmation-failed": "Confirmation failed",
"token-expiration": "This is probably due to token expiration.",
"try-confirm-again": "Please try again and if this error keeps occuring, contact the site administrator.",
"registration-finished": "Registration finished succesfully!",
"activate-account": "Please activate your account via the link in the mail we just sent you.",
"find-email": "Make sure to check your 'Spam' folder if you can't find the email in your inbox.",
"close-window": "You can now close this window.",
"register": "Register",
"email": "Email",
"repeat_password": "Repeat password",
"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",
"repeat-password": "Repeat password",
"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",
Expand All @@ -157,11 +157,11 @@
"groupPredicates": "traverse predicate"
},
"semsearch-subtitle": "Find linked data items based on semantic features",
"optional_label_placeholder": "optional label for reference",
"optional-label-placeholder": "optional label for reference",
"semsearch-submit": "Search",
"show_hide_metadata": "Show / hide the source metadata",
"show_hide_annotations": "Show / hide annotations",
"upload_source": "Upload source",
"show-hide-metadata": "Show / hide the source metadata",
"show-hide-annotations": "Show / hide annotations",
"upload-source": "Upload source",
"title": "Title",
"author": "Author",
"editor": "Editor (optional)",
Expand Down
Loading

0 comments on commit 4a10968

Please sign in to comment.