Skip to content

Commit 5f67e04

Browse files
authored
[module_manager] Add translations to Japanese for module manager (#10166)
Add translations to the module manager for Japanese and update some template strings to be full sentences instead of sentence fragments, so that they can be translated in a grammatically correct way.
1 parent 35723fe commit 5f67e04

File tree

4 files changed

+39
-9
lines changed

4 files changed

+39
-9
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ locales:
175175
msgfmt -o modules/module_manager/locale/ja/LC_MESSAGES/module_manager.mo modules/module_manager/locale/ja/LC_MESSAGES/module_manager.po
176176
msgfmt -o modules/module_manager/locale/hi/LC_MESSAGES/module_manager.mo modules/module_manager/locale/hi/LC_MESSAGES/module_manager.po
177177
npx i18next-conv -l hi -s modules/module_manager/locale/hi/LC_MESSAGES/module_manager.po -t modules/module_manager/locale/hi/LC_MESSAGES/module_manager.json
178+
npx i18next-conv -l ja -s modules/module_manager/locale/ja/LC_MESSAGES/module_manager.po -t modules/module_manager/locale/ja/LC_MESSAGES/module_manager.json
178179
msgfmt -o modules/mri_violations/locale/ja/LC_MESSAGES/mri_violations.mo modules/mri_violations/locale/ja/LC_MESSAGES/mri_violations.po
179180
msgfmt -o modules/my_preferences/locale/hi/LC_MESSAGES/my_preferences.mo modules/my_preferences/locale/hi/LC_MESSAGES/my_preferences.po
180181
npx i18next-conv -l ja -s modules/my_preferences/locale/ja/LC_MESSAGES/my_preferences.po -t modules/my_preferences/locale/ja/LC_MESSAGES/my_preferences.json --compatibilityJSON v4

modules/module_manager/jsx/modulemanager.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {SelectElement} from 'jsx/Form';
88
import {withTranslation} from 'react-i18next';
99
import i18n from 'I18nSetup';
1010
import hiStrings from '../locale/hi/LC_MESSAGES/module_manager.json';
11+
import jaStrings from '../locale/ja/LC_MESSAGES/module_manager.json';
1112

1213
/**
1314
* Module Manager React Component
@@ -99,18 +100,21 @@ class ModuleManagerIndex extends Component {
99100
if (response.status != 205) {
100101
swal.fire(
101102
t('Error!', {ns: 'loris'}),
102-
t('Could not update', {ns: 'module_manager'}) + ' ' + name + '.',
103+
t('Could not update {{name}}.', {ns: 'module_manager', name: name}),
103104
'error'
104105
);
105106
} else {
106107
const success = this.setModuleDisplayStatus(name, value);
107108
if (success === true) {
108109
swal.fire({
109110
title: t('Success!', {ns: 'loris'}),
110-
text: t('Updated', {ns: 'loris'}) + ' ' + name + ' ' +
111-
t('status!', {ns: 'module_manager'}) + ' ' +
112-
t('To apply changes the interface must be reloaded. Proceed?',
113-
{ns: 'module_manager'}),
111+
text: t(
112+
'Updated {{name}} status!',
113+
{ns: 'module_manager', name: name}
114+
) + t(
115+
'To apply changes the interface must be reloaded. Proceed?',
116+
{ns: 'module_manager'}
117+
),
114118
type: 'success',
115119
showCancelButton: true,
116120
confirmButtonText: t('Reload the page', {ns: 'module_manager'}),
@@ -126,7 +130,7 @@ class ModuleManagerIndex extends Component {
126130
// a module was toggled that isn't in the table.
127131
swal.fire(
128132
t('Error!', {ns: 'loris'}),
129-
t('Could not find module', {ns: 'module_manager'}) + ' ' + id + '.',
133+
t('Could not find module {{id}}.', {ns: 'module_manager', id: id}),
130134
'error'
131135
);
132136
}
@@ -253,6 +257,7 @@ const TranslatedModuleManagerIndex = withTranslation(
253257

254258
window.addEventListener('load', () => {
255259
i18n.addResourceBundle('hi', 'module_manager', hiStrings);
260+
i18n.addResourceBundle('ja', 'module_manager', jaStrings);
256261
createRoot(
257262
document.getElementById('lorisworkspace')
258263
).render(

modules/module_manager/locale/ja/LC_MESSAGES/module_manager.po

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,27 @@ msgstr ""
2121
msgid "Module Manager"
2222
msgstr "モジュールマネージャー"
2323

24+
msgid "Name"
25+
msgstr "モジュール名"
26+
27+
msgid "Full Name"
28+
msgstr "フルネーム"
29+
30+
msgid "Could not update {{name}}"
31+
msgstr "{{name}} を更新できませんでした。"
32+
33+
msgid "Updated {{name}} status!"
34+
msgstr ""
35+
36+
msgid "To apply changes the interface must be reloaded. Proceed?"
37+
msgstr "変更を適用するには、インターフェースを再読み込みする必要があります。続行しますか?"
38+
39+
msgid "Reload the page"
40+
msgstr "ページを再読み込みする"
41+
42+
msgid "Continue"
43+
msgstr "続く"
44+
45+
msgid "Could not find module {{id}}."
46+
msgstr "モジュール {{id}} が見つかりませんでした。"
47+

modules/module_manager/locale/module_manager.pot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ msgstr ""
2727
msgid "Full Name"
2828
msgstr ""
2929

30-
msgid "Could not update"
30+
msgid "Could not update {{name}}."
3131
msgstr ""
3232

33-
msgid "status!"
33+
msgid "Updated {{name}} status!"
3434
msgstr ""
3535

3636
msgid "To apply changes the interface must be reloaded. Proceed?"
@@ -42,6 +42,6 @@ msgstr ""
4242
msgid "Continue"
4343
msgstr ""
4444

45-
msgid "Could not find module"
45+
msgid "Could not find module {{id}}"
4646
msgstr ""
4747

0 commit comments

Comments
 (0)