Skip to content

[candidate_list] Translate candidate_list module #9797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
8 changes: 7 additions & 1 deletion .github/workflows/loristest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ jobs:
cd modules/electrophysiology_browser/jsx/react-series-data-viewer/
protoc protocol-buffers/chunk.proto --js_out=import_style=commonjs,binary:./src/

- name: Install other package dependencies
run: sudo apt install -y gettext

- name: Install npm modules
run: npm ci

- name: Generate LORIS locales
run: make locales

- name: Compile LORIS javascript
run: npm run compile

Expand Down Expand Up @@ -265,7 +271,7 @@ jobs:
# that updated the list of installed apt packages/apt repositories. That issue may disappear in future Ubuntu images.
run: |
sudo apt install -y imagemagick-6-common libmagickcore-6.q16-7t64 libmagickwand-6.q16-7t64 \
libprotobuf-dev libprotobuf32t64 libprotoc32t64 protobuf-compiler
libprotobuf-dev libprotobuf32t64 libprotoc32t64 protobuf-compiler gettext
cd modules/electrophysiology_browser/jsx/react-series-data-viewer/
protoc protocol-buffers/chunk.proto --js_out=import_style=commonjs,binary:./src/

Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: clean dev all check checkstatic unittests phpdev jslatest testdata fastdev jsdev
.PHONY: clean dev all check checkstatic unittests phpdev jslatest testdata fastdev jsdev locales

all: VERSION
all: locales VERSION
composer install --no-dev
npm ci
npm run build
Expand All @@ -12,7 +12,7 @@ VERSION: .
phpdev:
composer install

dev: phpdev jsdev fastdev
dev: locales phpdev jsdev fastdev

jsdev:
npm ci
Expand Down Expand Up @@ -59,6 +59,7 @@ testdata:

locales:
msgfmt -o locale/ja/LC_MESSAGES/loris.mo locale/ja/LC_MESSAGES/loris.po
npx i18next-conv -l ja -s locale/ja/LC_MESSAGES/loris.po -t locale/ja/LC_MESSAGES/loris.json
msgfmt -o modules/new_profile/locale/ja/LC_MESSAGES/new_profile.mo modules/new_profile/locale/ja/LC_MESSAGES/new_profile.po
msgfmt -o modules/acknowledgements/locale/ja/LC_MESSAGES/acknowledgements.mo modules/acknowledgements/locale/ja/LC_MESSAGES/acknowledgements.po
msgfmt -o modules/api_docs/locale/ja/LC_MESSAGES/api_docs.mo modules/api_docs/locale/ja/LC_MESSAGES/api_docs.po
Expand All @@ -67,6 +68,7 @@ locales:
msgfmt -o modules/brainbrowser/locale/ja/LC_MESSAGES/brainbrowser.mo modules/brainbrowser/locale/ja/LC_MESSAGES/brainbrowser.po
msgfmt -o modules/bvl_feedback/locale/ja/LC_MESSAGES/bvl_feedback.mo modules/bvl_feedback/locale/ja/LC_MESSAGES/bvl_feedback.po
msgfmt -o modules/candidate_list/locale/ja/LC_MESSAGES/candidate_list.mo modules/candidate_list/locale/ja/LC_MESSAGES/candidate_list.po
npx i18next-conv -l ja -s modules/candidate_list/locale/ja/LC_MESSAGES/candidate_list.po -t modules/candidate_list/locale/ja/LC_MESSAGES/candidate_list.json
msgfmt -o modules/candidate_parameters/locale/ja/LC_MESSAGES/candidate_parameters.mo modules/candidate_parameters/locale/ja/LC_MESSAGES/candidate_parameters.po
msgfmt -o modules/candidate_profile/locale/ja/LC_MESSAGES/candidate_profile.mo modules/candidate_profile/locale/ja/LC_MESSAGES/candidate_profile.po
msgfmt -o modules/configuration/locale/ja/LC_MESSAGES/configuration.mo modules/configuration/locale/ja/LC_MESSAGES/configuration.po
Expand Down Expand Up @@ -131,6 +133,8 @@ issue_tracker:
target=issue_tracker npm run compile

candidate_list:
msgfmt -o modules/candidate_list/locale/ja/LC_MESSAGES/candidate_list.mo modules/candidate_list/locale/ja/LC_MESSAGES/candidate_list.po
npx i18next-conv -l ja -s modules/candidate_list/locale/ja/LC_MESSAGES/candidate_list.po -t modules/candidate_list/locale/ja/LC_MESSAGES/candidate_list.json
target=candidate_list npm run compile

candidate_parameters:
Expand Down
27 changes: 27 additions & 0 deletions jsx/I18nSetup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import i18n from 'i18next';
import {initReactI18next} from 'react-i18next';

import jaResources from '../locale/ja/LC_MESSAGES/loris.json';

const resources = {
ja: {
loris: jaResources,
},
};

i18n
.use(initReactI18next) // passes i18n down to react-i18next
.init({
resources,
// debug: true,
partialBundledLanguages: true,
lng: loris.user.langpref ?? 'en',
interpolation: {
escapeValue: false, // react already safes from xss
},
// Modules add to this with addResourceBundle
ns: ['loris'],
defaultNS: 'loris',
fallbackNS: [],
});
export default i18n;
49 changes: 49 additions & 0 deletions locale/ja/LC_MESSAGES/loris.po
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,52 @@ msgstr "はい"
msgid "No"
msgstr "いいえ"

# Filters
msgid "Selection Filter"
msgstr "'選択フィルター"

msgid "Show Filters"
msgstr "フィルターを表示"

msgid "Hide Filters"
msgstr "フィルターを非表示"

msgid "Clear Filters"
msgstr "フィルターをクリア"

# Common candidate terms
msgid "PSCID"
msgstr "プロジェクト識別子"

msgid "DCCID"
msgstr "候補者識別子"

msgid "Visit Label"
msgstr "ラベルを訪問"

msgid "Site"
msgstr "サイト"

msgid "Project"
msgstr "プロジェクト"

msgid "Cohort"
msgstr "コホート"

msgid "Date of registration"
msgstr "入学日"

msgid "Participant Status"
msgstr "参加者ステータス"

msgid "DoB"
msgstr "生年月日"

msgid "Sex"
msgstr "性別"

msgid "Feedback"
msgstr "フィードバック"

msgid "Scans"
msgstr "スキャン"
36 changes: 36 additions & 0 deletions locale/loris.pot
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,39 @@ msgstr ""
msgid "No"
msgstr ""

# Common candidate terms
msgid "PSCID"
msgstr ""

msgid "DCCID"
msgstr ""

msgid "Visit Label"
msgstr ""

msgid "Site"
msgstr ""

msgid "Project"
msgstr ""

msgid "Cohort"
msgstr ""

msgid "Date of registration"
msgstr ""

msgid "Participant Status"
msgstr ""

msgid "DoB"
msgstr ""

msgid "Sex"
msgstr ""

msgid "Feedback"
msgstr ""

msgid "Scans"
msgstr ""
Loading
Loading