Skip to content

Commit 5796a8d

Browse files
committed
Localize the step options and the model attribute names
The settings page rendered "15 min" with hard-coded English, and IssueDatetime validation messages fell back to raw attribute names in every locale. Both now come from the locale files, EN and JA (#18).
1 parent 014db54 commit 5796a8d

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

app/views/settings/_redmine_issue_datetime.html.erb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
<p>
1313
<label><%= l(:label_issue_datetime_step) %></label>
1414
<%= select_tag 'settings[time_step]',
15-
options_for_select([5, 10, 15, 30, 60].map { |m| ["#{m} min", m.to_s] },
16-
RedmineIssueDatetime.settings['time_step']) %>
15+
options_for_select(
16+
[5, 10, 15, 30, 60].map { |m| [l(:label_issue_datetime_step_minutes, count: m), m.to_s] },
17+
RedmineIssueDatetime.settings['time_step']
18+
) %>
1719
</p>
1820
<p>
1921
<label><%= l(:label_issue_datetime_zone) %></label>

config/locales/en.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
en:
2+
activerecord:
3+
attributes:
4+
issue_datetime:
5+
starts_at: Start time
6+
ends_at: Due time
27
field_start_time: Start time
38
field_due_time: Due time
49
field_all_day: All day
510
label_datetime: Date and time
611
text_datetime_cf_zone_hint: "Values are entered and shown in %{zone}, the reference time zone configured for this plugin."
712
label_issue_datetime_trackers: Enabled for trackers
813
label_issue_datetime_step: Time input step
14+
label_issue_datetime_step_minutes: "%{count} min"
915
label_issue_datetime_zone: Reference time zone
1016
label_issue_datetime_zone_default: Application default
1117
text_issue_datetime_zone_hint: Used to derive the date part mirrored into the start and due date fields.

config/locales/ja.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
ja:
2+
activerecord:
3+
attributes:
4+
issue_datetime:
5+
starts_at: 開始時刻
6+
ends_at: 期日時刻
27
field_start_time: 開始時刻
38
field_due_time: 期日時刻
49
field_all_day: 終日
510
label_datetime: 日付と時刻
611
text_datetime_cf_zone_hint: "値はこのプラグインで設定した基準タイムゾーン %{zone} で入力・表示されます。"
712
label_issue_datetime_trackers: 有効にするトラッカー
813
label_issue_datetime_step: 時刻入力の間隔
14+
label_issue_datetime_step_minutes: "%{count}分"
915
label_issue_datetime_zone: 基準タイムゾーン
1016
label_issue_datetime_zone_default: アプリケーションのデフォルト
1117
text_issue_datetime_zone_hint: 開始日・期日に反映する日付の算出に使用します。

0 commit comments

Comments
 (0)