Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ locales:
msgfmt -o modules/examiner/locale/ja/LC_MESSAGES/examiner.mo modules/examiner/locale/ja/LC_MESSAGES/examiner.po
msgfmt -o modules/genomic_browser/locale/ja/LC_MESSAGES/genomic_browser.mo modules/genomic_browser/locale/ja/LC_MESSAGES/genomic_browser.po
msgfmt -o modules/help_editor/locale/ja/LC_MESSAGES/help_editor.mo modules/help_editor/locale/ja/LC_MESSAGES/help_editor.po
msgfmt -o modules/help_editor/locale/hi/LC_MESSAGES/help_editor.mo modules/help_editor/locale/hi/LC_MESSAGES/help_editor.po
npx i18next-conv -l hi -s modules/help_editor/locale/hi/LC_MESSAGES/help_editor.po -t modules/help_editor/locale/hi/LC_MESSAGES/help_editor.json
msgfmt -o modules/imaging_browser/locale/ja/LC_MESSAGES/imaging_browser.mo modules/imaging_browser/locale/ja/LC_MESSAGES/imaging_browser.po
msgfmt -o modules/imaging_qc/locale/ja/LC_MESSAGES/imaging_qc.mo modules/imaging_qc/locale/ja/LC_MESSAGES/imaging_qc.po
msgfmt -o modules/imaging_uploader/locale/ja/LC_MESSAGES/imaging_uploader.mo modules/imaging_uploader/locale/ja/LC_MESSAGES/imaging_uploader.po
Expand Down
84 changes: 75 additions & 9 deletions locale/hi/LC_MESSAGES/loris.po
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,31 @@ msgstr "हाँ"
msgid "No"
msgstr "नहीं"

msgid "Close"
msgstr "बंद करें"

msgid "Create"
msgstr "बनाएँ"

# Filters
msgid "Selection Filter"
msgstr "चयन फ़िल्टर"

msgid "Show Filters"
msgstr "फ़िल्टर दिखाएँ"

msgid "Hide Filters"
msgstr "फ़िल्टर छुपाएँ"

msgid "Clear Filters"
msgstr "फ़िल्टर साफ़ करें"

msgid "Show Advanced Filters"
msgstr "उन्नत फ़िल्टर दिखाएँ"

msgid "Hide Advanced Filters"
msgstr "उन्नत फ़िल्टर छुपाएँ"

# Common swal labels
msgid "Cancel"
msgstr "रद्द करें"
Expand All @@ -149,11 +171,15 @@ msgstr "मॉड्यूल"
msgid "Project"
msgstr "परियोजना"

msgid "Cohort"
msgstr "समूह"
msgid "Candidate Registration Project"
msgstr "उम्मीदवार पंजीकरण परियोजना"

msgid "Cohorts"
msgstr "समूह"
msgid "Timepoint Project"
msgstr "समय बिंदु परियोजना"

msgid "Cohort"
msgid_plural "Cohorts"
msgstr[0] "समूह"

msgid "Session"
msgstr "सत्र"
Expand Down Expand Up @@ -182,6 +208,9 @@ msgstr "चरण"
msgid "Sent To DCC"
msgstr "डीसीसी को भेजा गया"

msgid "Reverse Send To DCC"
msgstr "डीसीसी को भेजना उलटना"

msgid "Date of Birth"
msgstr "जन्म तिथि"

Expand All @@ -197,11 +226,8 @@ msgstr "इकाई प्रकार"
msgid "Scan Done"
msgstr "स्कैन पूरा हुआ"

msgid "Show Advanced Filters"
msgstr "उन्नत फ़िल्टर दिखाएँ"

msgid "Hide Advanced Filters"
msgstr "उन्नत फ़िल्टर छुपाएँ"
msgid "Save"
msgstr "सहेजें"

msgid "Language"
msgstr "भाषा"
Expand Down Expand Up @@ -266,3 +292,43 @@ msgstr "निकासी"

msgid "In Progress"
msgstr "प्रगति पर"

msgid "Complete"
msgstr "पूर्ण"

msgid "Instruments"
msgstr "उपकरण"

msgid "None"
msgstr "कोई नहीं"

msgid "Partial"
msgstr "आंशिक"

msgid "All"
msgstr "सभी"

msgid "Data Entry"
msgstr "डेटा प्रविष्टि"

msgid "Administration"
msgstr "प्रशासन"

msgid "Double Data Entry Form"
msgstr "दोहरी डेटा प्रविष्टि फ़ॉर्म"

msgid "Double Data Entry Status"
msgstr "दोहरी डेटा प्रविष्टि स्थिति"

msgid "Double Data Entry"
msgstr "दोहरी डेटा प्रविष्टि"

# Age related terms
msgid "Age"
msgstr "आयु"

msgid "{{months}} months old"
msgstr "{{months}} महीने का"

msgid "{{years}} years old"
msgstr "{{years}} वर्ष का"
9 changes: 6 additions & 3 deletions locale/loris.pot
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ msgstr ""
msgid "No"
msgstr ""

msgid "Close"
msgstr ""

msgid "Create"
msgstr ""

Expand Down Expand Up @@ -207,9 +210,6 @@ msgstr ""
msgid "Send To DCC"
msgstr ""

msgid "Sent To DCC"
msgstr ""

msgid "Reverse Send To DCC"
msgstr ""

Expand All @@ -231,6 +231,9 @@ msgstr ""
msgid "Language"
msgstr ""

msgid "Save"
msgstr ""

# Data table strings
msgid "{{pageCount}} rows displayed of {{totalCount}}."
msgstr ""
Expand Down
30 changes: 20 additions & 10 deletions modules/help_editor/jsx/helpEditorForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import Markdown from 'jsx/Markdown';
import Help from 'jsx/Help';
import swal from 'sweetalert2';
import {TextboxElement, TextareaElement} from 'jsx/Form';
import {withTranslation} from 'react-i18next';
import i18n from 'I18nSetup';
import hiStrings from '../locale/hi/LC_MESSAGES/help_editor.json';

/**
* Help Editor Form Page.
Expand All @@ -19,6 +22,7 @@ import {TextboxElement, TextareaElement} from 'jsx/Form';
*/

const HelpEditorForm = (props) => {
const {t} = props;
const [title, setTitle] = useState(props.title ?? '');
const [content, setContent] = useState(props.content ?? '');
const helpPreview = [];
Expand Down Expand Up @@ -69,17 +73,19 @@ const HelpEditorForm = (props) => {
return;
}
swal.fire({
title: 'Content update successful!',
title: t('Content update successful!',
{ns: 'help_editor'}),
type: 'success',
confirmButtonText: 'Close',
confirmButtonText: t('Close', {ns: 'loris'}),
});
}).catch((error) => {
console.error(error);
swal.fire({
title: 'Content update unsuccessful.',
text: 'Something went wrong',
title: t('Content update unsuccessful.',
{ns: 'help_editor'}),
text: t('Something went wrong', {ns: 'help_editor'}),
type: 'error',
confirmButtonText: 'Try again',
confirmButtonText: t('Try again', {ns: 'help_editor'}),
});
});
};
Expand All @@ -95,27 +101,28 @@ const HelpEditorForm = (props) => {
<div className="row">
<div className="col-sm-9">
<TextboxElement
label='Title'
label={t('Title', {ns: 'help_editor'})}
name='title'
value={title}
onUserInput={onUserInput}
/>
<TextareaElement
label='Content'
label={t('Content', {ns: 'help_editor'})}
rows={15}
name='content'
value={content}
onUserInput={onUserInput}
/>
<div className="col-sm-9 col-sm-offset-3">
<p><small>
Open the help dialog to preview the changes.
{t('Open the help dialog to preview the changes.',
{ns: 'help_editor'})}
</small></p>
<input
className="btn btn-sm btn-primary"
id="save-help"
name="fire_away"
value="Save"
value={t('Save', {ns: 'loris'})}
type="submit"
onClick={save}
/>
Expand All @@ -135,6 +142,9 @@ HelpEditorForm.propTypes = {
subsection: PropTypes.string,
helpid: PropTypes.string,
url: PropTypes.string,
t: PropTypes.func,
};

window.RHelpEditorForm = React.createFactory(HelpEditorForm);
i18n.addResourceBundle('hi', 'help_editor', hiStrings);
window.RHelpEditorForm = React.createFactory(
withTranslation(['help_editor'])(HelpEditorForm));
28 changes: 20 additions & 8 deletions modules/help_editor/jsx/help_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import Loader from 'Loader';
import PropTypes from 'prop-types';
import {createRoot} from 'react-dom/client';
import React from 'react';
import i18n from 'I18nSetup';
import hiStrings from '../locale/hi/LC_MESSAGES/help_editor.json';
import {withTranslation} from 'react-i18next';


/**
* Help Editor Archive Page.
Expand Down Expand Up @@ -67,13 +71,14 @@ class HelpEditor extends React.Component {
* @return {*} a formatted table cell for a given column
*/
formatColumn(column, cell, row) {
const {t} = this.props;
let url;
let result = <td>{cell}</td>;
switch (column) {
case 'Topic':
case t('Topic', {ns: 'help_editor'}):
url = loris.BaseURL + '/help_editor/edit_help_content/?helpID='
+ row['Help ID'];
result = <td><a href ={url}>{cell}</a></td>;
+ row[t('Help ID', {ns: 'help_editor'})];
result = <td><a href={url}>{cell}</a></td>;
break;
}

Expand All @@ -86,10 +91,12 @@ class HelpEditor extends React.Component {
* @return {JSX} - React markup for the component
*/
render() {
const {t} = this.props;
// If error occurs, return a message.
// XXX: Replace this with a UI component for 500 errors.
if (this.state.error) {
return <h3>An error occured while loading the page.</h3>;
return <h3>{t('An error occured while loading the page.',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loris namespace

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes,
image

please point to the correct namespace @SKADE2303

{ns: 'loris'})}</h3>;
}

// Waiting for async data to load
Expand All @@ -103,12 +110,12 @@ class HelpEditor extends React.Component {
* queried columns in _setupVariables() in media.class.inc
*/
const fields = [
{label: 'Help ID', show: false},
{label: 'Topic', show: true, filter: {
{label: t('Help ID', {ns: 'help_editor'}), show: false},
{label: t('Topic', {ns: 'help_editor'}), show: true, filter: {
name: 'topic',
type: 'text',
}},
{label: 'Content', show: true, filter: {
{label: t('Content', {ns: 'help_editor'}), show: true, filter: {
name: 'content',
type: 'text',
}},
Expand All @@ -127,13 +134,18 @@ class HelpEditor extends React.Component {

HelpEditor.propTypes = {
dataURL: PropTypes.string.isRequired,
t: PropTypes.func,
};

const TranslatedHelpEditor = withTranslation(
['help_editor'])(HelpEditor);

window.addEventListener('load', () => {
i18n.addResourceBundle('hi', 'help_editor', hiStrings);
createRoot(
document.getElementById('lorisworkspace')
).render(
<HelpEditor
<TranslatedHelpEditor
Module="help_editor"
dataURL={loris.BaseURL + '/help_editor/?format=json'}
/>
Expand Down
29 changes: 29 additions & 0 deletions modules/help_editor/locale/help_editor.pot
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,32 @@ msgstr ""
msgid "Help Editor"
msgstr ""

msgid "Edit Help Content"
msgstr ""

msgid "Help ID"
msgstr ""

msgid "Topic"
msgstr ""

msgid "Content"
msgstr ""

msgid "Title"
msgstr ""

msgid "Open the help dialog to preview the changes."
msgstr ""

msgid "Content update successful!"
msgstr ""

msgid "Content update unsuccessful."
msgstr ""

msgid "Something went wrong"
msgstr ""

msgid "Try again"
msgstr ""
Loading
Loading