Skip to content

Commit

Permalink
Use the output of i18next-parser (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed Apr 20, 2022
1 parent 695f23f commit 4e1cf4b
Show file tree
Hide file tree
Showing 5 changed files with 312 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ trim_trailing_whitespace = true

[**/package.json]
indent_size = 2

[frontend/src/i18n/*/translation.json]
indent_size = 2
6 changes: 5 additions & 1 deletion frontend/src/global/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Deferred } from 'jquery';
import * as i18next from 'i18next';
import * as languageDetector from 'i18next-browser-languagedetector';

import * as french from '../i18n/fr.json';
import * as english from '../i18n/en/translation.json';
import * as french from '../i18n/fr/translation.json';

const deferred = Deferred();
const i18nPromise = deferred.promise();
Expand All @@ -12,6 +13,9 @@ i18next.use(
).init({
fallbackLng: ['en', 'dev'],
resources: {
en: {
translation: english,
},
fr: {
translation: french,
},
Expand Down
152 changes: 152 additions & 0 deletions frontend/src/i18n/en/translation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"heading": {
"annotations": "Annotations"
},
"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.",
"submit": "Submit",
"developed_by": "Developed by",
"add": "Add",
"define_category": "This is a",
"remove": "Remove",
"filterHierarchy": {
"mine": "by me",
"others": "by others",
"verified": "verified",
"unverified": "unverified",
"semantic": "human",
"nlp": "automated"
},
"permitted_types_before_list": "This property permits",
"current_type": "Current type:",
"typeHints": {
"integer": "",
"base64Binary": "",
"gYear": "",
"string": ""
},
"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",
"interpunction": {
"colon": ":",
"paragraph_ellipsis": "(...)"
},
"sources": "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",
"username": "Username",
"password": "Password",
"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",
"menu": "menu",
"about_tooltip": "Find out more about the READ-IT project",
"about": "About",
"search_tooltip": "Search reading experiences and annotations",
"search": "Search",
"explore_tooltip": "Get a random selection of reading experiences and annotations",
"explore": "Explore",
"upload_tooltip": "Upload reading testimonies for annotation",
"upload": "Upload",
"contribute_tooltip": "Find out how to contribute to READ-IT",
"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",
"not_found_text": "}\n 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.\n{",
"pagination": "pagination",
"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.",
"save": "Save",
"delete": "Delete",
"annotation": "Annotation",
"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",
"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.",
"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",
"semsearch-subtitle": "Find linked data items based on semantic features",
"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",
"title": "Title",
"author": "Author",
"editor": "Editor (optional)",
"file": "File",
"search-tab-text": "Textual search",
"search-tab-semantic": "Semantic search"
}
4 changes: 0 additions & 4 deletions frontend/src/i18n/fr.json

This file was deleted.

152 changes: 152 additions & 0 deletions frontend/src/i18n/fr/translation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"heading": {
"annotations": "Annotations"
},
"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.",
"submit": "Submit",
"developed_by": "Developed by",
"add": "Add",
"define_category": "This is a",
"remove": "Remove",
"filterHierarchy": {
"mine": "by me",
"others": "by others",
"verified": "verified",
"unverified": "unverified",
"semantic": "human",
"nlp": "automated"
},
"permitted_types_before_list": "This property permits",
"current_type": "Current type:",
"typeHints": {
"integer": "",
"base64Binary": "",
"gYear": "",
"string": ""
},
"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",
"interpunction": {
"colon": ":",
"paragraph_ellipsis": "(...)"
},
"sources": "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",
"username": "Username",
"password": "Password",
"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",
"menu": "menu",
"about_tooltip": "Find out more about the READ-IT project",
"about": "About",
"search_tooltip": "Search reading experiences and annotations",
"search": "Search",
"explore_tooltip": "Get a random selection of reading experiences and annotations",
"explore": "Explore",
"upload_tooltip": "Upload reading testimonies for annotation",
"upload": "Upload",
"contribute_tooltip": "Find out how to contribute to READ-IT",
"contribute": "Contribute",
"greeting": "Bonjour {{name}}!",
"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",
"not_found_text": "}\n 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.\n{",
"pagination": "pagination",
"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.",
"save": "Save",
"delete": "Delete",
"annotation": "Annotation",
"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",
"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.",
"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",
"semsearch-subtitle": "Find linked data items based on semantic features",
"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",
"title": "Title",
"author": "Author",
"editor": "Editor (optional)",
"file": "File",
"search-tab-text": "Textual search",
"search-tab-semantic": "Semantic search"
}

0 comments on commit 4e1cf4b

Please sign in to comment.