Skip to content
Merged
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
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ locales:
msgfmt -o modules/configuration/locale/ja/LC_MESSAGES/configuration.mo modules/configuration/locale/ja/LC_MESSAGES/configuration.po
msgfmt -o modules/configuration/locale/ja/LC_MESSAGES/configuration.mo modules/configuration/locale/ja/LC_MESSAGES/configuration.po
msgfmt -o modules/conflict_resolver/locale/ja/LC_MESSAGES/conflict_resolver.mo modules/conflict_resolver/locale/ja/LC_MESSAGES/conflict_resolver.po
npx i18next-conv -l ja -s modules/conflict_resolver/locale/ja/LC_MESSAGES/conflict_resolver.po -t modules/conflict_resolver/locale/ja/LC_MESSAGES/conflict_resolver.json
msgfmt -o modules/create_timepoint/locale/ja/LC_MESSAGES/create_timepoint.mo modules/create_timepoint/locale/ja/LC_MESSAGES/create_timepoint.po
npx i18next-conv -l ja -s modules/create_timepoint/locale/ja/LC_MESSAGES/create_timepoint.po -t modules/create_timepoint/locale/ja/LC_MESSAGES/create_timepoint.json
msgfmt -o modules/create_timepoint/locale/es/LC_MESSAGES/create_timepoint.mo modules/create_timepoint/locale/es/LC_MESSAGES/create_timepoint.po
Expand Down
30 changes: 19 additions & 11 deletions modules/conflict_resolver/jsx/CandidateConflictsWidget.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import '../../../node_modules/c3/c3.css';
import c3 from 'c3';
import React, {useEffect} from 'react';
import React, {useEffect, useState} from 'react';
import PropTypes from 'prop-types';
import {useTranslation} from 'react-i18next';
import 'I18nSetup';
import jaStrings from '../locale/ja/LC_MESSAGES/conflict_resolver.json';

/**
* Renders a representation of the candidate conflicts as a React
Expand All @@ -11,10 +14,12 @@ import PropTypes from 'prop-types';
* @return {object}
*/
function CandidateConflictsWidget(props) {
const visits = getVisits(props.Conflicts);
const instruments = getInstruments(props.Conflicts);

const {t, i18n} = useTranslation();
const [reload, setReload] = useState(0);
useEffect(() => {
const visits = getVisits(props.Conflicts);
const instruments = getInstruments(props.Conflicts);
i18n.addResourceBundle('ja', 'conflict_resolver', jaStrings);
c3.generate({
bindto: '#conflictschart',
data: {
Expand All @@ -34,14 +39,14 @@ function CandidateConflictsWidget(props) {
type: 'category',
categories: visits,
label: {
text: 'Visit',
text: t('Visit', {ns: 'loris'}),
position: 'outer-center',
},
},
y: {
label: {
position: 'outer-middle',
text: 'Number of Conflicts',
text: t('Number of Conflicts', {ns: 'conflict_resolver'}),
},
},
},
Expand All @@ -58,18 +63,21 @@ function CandidateConflictsWidget(props) {
},
},
});
});
setReload(reload+1);
}, [t]);

return <div>
<div id='conflictschart' />
<ul>
<li>
{'Click on instrument in legend to visit conflict resolver '
+ 'for that instrument across all visits.'}
{t('Click on instrument in legend to visit conflict resolver '
+ 'for that instrument across all visits.',
{ns: 'conflict_resolver'})}
</li>
<li>
{'Click on bar in graph to visit conflict resolver '
+ 'for that visit and instrument combination.'}
{t('Click on bar in graph to visit conflict resolver '
+ 'for that visit and instrument combination.',
{ns: 'conflict_resolver'})}
</li>
</ul>
</div>;
Expand Down
8 changes: 8 additions & 0 deletions modules/conflict_resolver/locale/conflict_resolver.pot
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,11 @@ msgstr ""
msgid "Unresolved Conflicts"
msgstr ""

msgid "Number of Conflicts"
msgstr ""

msgid "Click on instrument in legend to visit conflict resolver for that instrument across all visits."
msgstr ""

msgid "Click on bar in graph to visit conflict resolver for that visit and instrument combination."
msgstr ""
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ msgstr "データ入力の競合"
msgid "Unresolved Conflicts"
msgstr "未解決の紛争"


msgid "Number of Conflicts"
msgstr "競合の数"

msgid "Click on instrument in legend to visit conflict resolver for that instrument across all visits."
msgstr "凡例の機器をクリックすると、すべての訪問にわたってその機器の競合解決ツールにアクセスできます。"

msgid "Click on bar in graph to visit conflict resolver for that visit and instrument combination."
msgstr "グラフ内のバーをクリックすると、その訪問と機器の組み合わせの競合解決ツールが表示されます。"
Loading