Skip to content

Commit 1faf1f5

Browse files
authored
Merge pull request #723 from kamatte-me/add-japanese
Add Japanese translation
2 parents c3a74ea + 37906e5 commit 1faf1f5

File tree

5 files changed

+208
-2
lines changed

5 files changed

+208
-2
lines changed

scripts/make.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const path = require('path')
1414
const root_dir = path.normalize(path.join(__dirname, '..'))
1515
const dist_dir = path.normalize(path.join(__dirname, '..', 'dist'))
1616

17-
const electronLanguages = ['en', 'fr', 'zh_CN', 'de']
17+
const electronLanguages = ['en', 'fr', 'zh_CN', 'de', 'ja']
1818

1919
const TARGET_PLATFORMS_configs = {
2020
mac: {

src/common/i18n/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import en from './languages/en'
88
import zh from './languages/zh'
99
import fr from './languages/fr'
1010
import de from './languages/de'
11+
import ja from './languages/ja'
1112
import { LanguageDict, LanguageKey } from '@root/common/types'
1213

1314
export const languages = {
@@ -17,6 +18,7 @@ export const languages = {
1718
'zh-CN': zh,
1819
fr,
1920
de,
21+
ja,
2022
}
2123

2224
export type LocaleName = keyof typeof languages

src/common/i18n/languages/ja.ts

+201
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
/**
2+
* @author: kamatte
3+
* @homepage: https://kamatte.me
4+
*/
5+
6+
import { LanguageDict } from '@root/common/types'
7+
8+
const lang: LanguageDict = {
9+
_app_name: 'SwitchHosts',
10+
_key: 'ja',
11+
_name: '日本語',
12+
about: 'SwitchHosts について',
13+
acknowledgement: '謝辞',
14+
advanced: '詳細設定',
15+
all: 'すべて',
16+
append: '追記',
17+
auto_refresh: '自動更新',
18+
btn_cancel: 'キャンセル',
19+
btn_ok: 'OK',
20+
change: '変更',
21+
check_update: 'アップデートを確認',
22+
choice_mode: '選択モード',
23+
choice_mode_default: 'デフォルト',
24+
choice_mode_desc:
25+
'最上位階層のhostsにのみ有効で、各フォルダーでは独自に選択モードを設定できます。',
26+
choice_mode_multiple: '複数',
27+
choice_mode_single: '単一',
28+
choices: '選択',
29+
chosen: '選択済み',
30+
clear_history: '履歴をクリア',
31+
click_to_open: 'クリックして開く',
32+
close: '閉じる',
33+
colon: ': ',
34+
commands: 'コマンド',
35+
commands_help:
36+
'hostsが適用されたとき、以下のシステムコマンドを実行します:',
37+
commands_title: 'hosts適用後のコマンド',
38+
comment_current_line: '現在の行をコメントアウト',
39+
content: '内容',
40+
copy: 'コピー',
41+
cut: '切り取り',
42+
day: '日',
43+
days: '日',
44+
delete: '削除',
45+
download: 'ダウンロード',
46+
edit: '編集',
47+
export: 'エクスポート',
48+
export_done: 'エクスポートが完了しました。',
49+
fail: '失敗',
50+
feedback: 'フィードバック',
51+
file: 'ファイル',
52+
find: '検索',
53+
find_all: 'すべて検索',
54+
find_and_replace: '検索と置換',
55+
find_history: '検索履歴',
56+
folder: 'フォルダー',
57+
front: '前面',
58+
general: '一般',
59+
group: 'グループ',
60+
help: 'ヘルプ',
61+
hide: '非表示',
62+
hide_at_launch: '起動時に非表示',
63+
hide_dock_icon: 'Dockアイコンを非表示',
64+
hide_history: '履歴を非表示',
65+
hide_others: 'その他を非表示にする',
66+
homepage: 'ホームページ',
67+
host: 'ホスト',
68+
hosts_add: 'hostsを追加',
69+
hosts_delete: 'hostsを削除',
70+
hosts_delete_confirm: 'このhostsを削除してもよろしいですか?',
71+
hosts_edit: 'hostsを編集',
72+
hosts_title: 'hostsタイトル',
73+
hosts_type: 'hostsタイプ',
74+
hosts_updated: 'hostsを更新しました。',
75+
hour: '時間',
76+
hours: '時間',
77+
http_api_on: 'HTTP APIを有効化',
78+
http_api_on_desc:
79+
'{0}番ポートで実行され、Alfredなどのサードパーティソフトウェアでhostsを切り替えるために使用できます。',
80+
http_api_only_local: 'HTTP APIを 127.0.0.1 のみでリッスンする',
81+
ignore_case: '大文字と小文字を区別しない',
82+
import: 'インポート',
83+
import_done: 'インポートが完了しました。',
84+
import_fail: 'インポートに失敗しました!',
85+
import_from_url: 'URLからインポート',
86+
is_latest_version_inform: 'ご利用のバージョンは最新です!',
87+
item_found: '{0}件見つかりました。',
88+
items: '件',
89+
items_found: '{0}件見つかりました。',
90+
language: '言語',
91+
last_refresh: '最終更新: ',
92+
latest_version_desc: '最新バージョン: {0}',
93+
line: '行',
94+
lines: '行',
95+
loading: '読み込み中...',
96+
local: 'ローカル',
97+
match: '一致',
98+
migrate_confirm:
99+
'SwitchHosts v4.0は新しいデータ保存形式を使用します。古いデータを新しい形式に移行しますか?',
100+
migrate_data: 'データ移行',
101+
minimize: '最小化',
102+
minute: '分',
103+
minutes: '分',
104+
move_items_to_trashcan: '{0}件をごみ箱に入れる',
105+
move_to_trashcan: 'ゴミ箱に入れる',
106+
multi_chose_folder_switch_all:
107+
'フォルダーの切り替えで配下のアイテムを一括操作',
108+
need_to_relaunch: '再起動が必要です',
109+
need_to_relaunch_after_setting_changed:
110+
'変更された設定はアプリケーションの再起動後に有効になります。',
111+
never: 'なし',
112+
new: '新規',
113+
new_version_found: '新しいバージョンが見つかりました',
114+
next: '次へ',
115+
no_access_to_hosts: 'hostsファイルの書き込み権限がありません。',
116+
no_record: 'なし',
117+
overwrite: '上書き',
118+
password: 'パスワード',
119+
paste: '貼り付け',
120+
port: 'ポート',
121+
preferences: '設定',
122+
previous: '前へ',
123+
protocol: 'プロトコル',
124+
proxy: 'プロキシ',
125+
quit: '終了',
126+
read_only: '読み取り専用',
127+
redo: 'やり直し',
128+
refresh: '更新',
129+
regexp: '正規表現',
130+
reload: '再読み込み',
131+
remote: 'リモート',
132+
remove_duplicate_records: '重複レコードを削除',
133+
remove_duplicate_records_desc:
134+
'1つのドメインに複数のIPアドレスを指定している場合、先頭のIPアドレスのみが有効になり、以降のIPアドレスはコメントに変換されます。',
135+
replace: '置換',
136+
replace_all: 'すべて置換',
137+
replace_history: '置換履歴',
138+
reset: 'リセット',
139+
reset_data_dir_confirm:
140+
'データフォルダーの場所をデフォルト ({0}) に戻してもよろしいですか?',
141+
reset_zoom: 'ズームをリセット',
142+
search: '検索',
143+
select_all: 'すべて選択',
144+
selected: '選択済み',
145+
show_dock_icon: 'Dockアイコンを表示',
146+
show_history: '履歴を表示',
147+
show_main_window: 'メインウィンドウを表示',
148+
show_title_on_tray: 'トレイにタイトルを表示',
149+
source_code: 'ソースコード',
150+
success: '成功',
151+
sudo_prompt_title: '管理者パスワードを入力してください',
152+
system_hosts: 'システムhosts',
153+
system_hosts_history: 'システムhostsのバージョン履歴',
154+
system_hosts_history_delete_confirm:
155+
'この履歴を削除してもよろしいですか?',
156+
system_hosts_history_help: '履歴件数がこれを超えると、最も古い履歴が削除されます。',
157+
system_hosts_history_limit: '履歴の最大件数: ',
158+
test: 'テスト',
159+
theme: 'テーマ',
160+
theme_dark: 'ダーク',
161+
theme_light: 'ライト',
162+
title: 'タイトル',
163+
to_show_source: 'ダブルクリックでソースコードを表示する。',
164+
toggle_developer_tools: '開発者ツールの表示/非表示',
165+
toggle_dock_icon: 'Dockアイコンの表示/非表示',
166+
toggle_full_screen: 'フルスクリーン',
167+
trashcan: 'ゴミ箱',
168+
trashcan_clear: 'ゴミ箱を空にする',
169+
trashcan_clear_confirm: 'ゴミ箱を空にしてもよろしいですか?',
170+
trashcan_delete_confirm: 'この項目を完全に削除しますか?',
171+
trashcan_restore: '戻す',
172+
tray_mini_window: 'タスクバーアイコンショートカット',
173+
undo: '元に戻す',
174+
unhide: 'すべて表示',
175+
untitled: '無題',
176+
url_placeholder: 'http:// または https:// または file://',
177+
usage_data_agree: 'はい、匿名の利用データを送信します。',
178+
usage_data_help:
179+
'匿名の利用データを定期的に送信し、SwitchHostsの改善にご協力いただけませんか?',
180+
usage_data_title: 'SwitchHostsの改善に協力する',
181+
use_proxy: 'プロキシを使用',
182+
use_system_window_frame:
183+
'システムのウィンドウフレームを使用。アプリケーションの再起動が必要です。',
184+
view: '表示',
185+
where_is_my_data: 'データはどこに保存されますか?',
186+
where_is_my_hosts: 'hostsファイルはどこにありますか?',
187+
window: 'ウィンドウ',
188+
write_mode: '書き込みモード',
189+
write_mode_append_help:
190+
'新しいレコードをシステムhostsの末尾に追記します。',
191+
write_mode_overwrite_help:
192+
'新しいレコードでシステムhostsを上書きします。',
193+
write_mode_set: '書き込みモードを設定',
194+
your_data_is: 'あなたのデータファイルはこちらに保存されています:',
195+
your_hosts_file_is: 'あなたのhostsファイルはこちらにあります:',
196+
zoom: 'ズーム',
197+
zoom_in: '拡大',
198+
zoom_out: '縮小',
199+
}
200+
201+
export default lang

src/main/ui/checkSystemLocale.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default async () => {
1616
return
1717
}
1818

19-
console.log(`Systel locale: ${locale}`)
19+
console.log(`System locale: ${locale}`)
2020
if (locale.startsWith('en')) {
2121
locale = 'en'
2222
} else if (locale.startsWith('zh')) {
@@ -25,6 +25,8 @@ export default async () => {
2525
locale = 'fr'
2626
} else if (locale.startsWith('de')) {
2727
locale = 'de'
28+
} else if (locale.startsWith('ja')) {
29+
locale = 'ja'
2830
}
2931

3032
if (!isLocaleName(locale)) {

src/renderer/components/Pref/General.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const General = (props: IProps) => {
5050
<option value="en">English</option>
5151
<option value="fr">Français</option>
5252
<option value="de">Deutsch</option>
53+
<option value="ja">日本語</option>
5354
</Select>
5455
</HStack>
5556
</FormControl>

0 commit comments

Comments
 (0)