diff options
-rw-r--r-- | config/locales/zh-TW.yml | 12 | ||||
-rw-r--r-- | lib/redmine/field_format.rb | 4 | ||||
-rw-r--r-- | test/unit/lib/redmine/field_format/progressbar_format_test.rb | 12 |
3 files changed, 20 insertions, 8 deletions
diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index efce04fa1..be2f7a0e4 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -369,7 +369,7 @@ field_priority: 優先權 field_fixed_version: 版本 field_user: 用戶 - field_principal: User or Group + field_principal: 用戶或群組 field_role: 角色 field_homepage: 網站首頁 field_is_public: 公開 @@ -1521,9 +1521,9 @@ setting_display_related_issues_table_headers: 顯示表格標題欄位 error_can_not_remove_role_reason_members_html: "<p>下列專案中有成員 屬於此角色:<br>%{projects}</p>" - setting_reactions_enabled: Enable reactions + setting_reactions_enabled: 啟用表情回應功能 reaction_text_x_other_users: - one: 1 other - other: "%{count} others" - text_setting_gravatar_default_initials_html: Users' initials are sent to <a href="https://www.gravatar.com">https://www.gravatar.com</a> - to generate their avatars. + one: 1 位其他用戶 + other: "%{count} 位其他用戶" + text_setting_gravatar_default_initials_html: 用戶姓名的首字母縮寫將被送往 <a href="https://www.gravatar.com">https://www.gravatar.com</a> + 用以產生其大頭貼. diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb index 3e87eeb38..39b21c874 100644 --- a/lib/redmine/field_format.rb +++ b/lib/redmine/field_format.rb @@ -1145,11 +1145,11 @@ module Redmine end def formatted_value(view, custom_field, value, customized=nil, html=false) - text = "#{value}%" if html + text = "#{value}%" view.progress_bar(value.to_i, legend: (text if view.action_name == 'show')) else - text + value.to_s end end end diff --git a/test/unit/lib/redmine/field_format/progressbar_format_test.rb b/test/unit/lib/redmine/field_format/progressbar_format_test.rb index 51bd8bc5f..6e0df724d 100644 --- a/test/unit/lib/redmine/field_format/progressbar_format_test.rb +++ b/test/unit/lib/redmine/field_format/progressbar_format_test.rb @@ -116,5 +116,17 @@ module Redmine::FieldFormat end end end + + def test_formatted_value_with_html_true + expected = progress_bar(50) + formatted = @format.formatted_value(self, @field, 50, Issue.new, true) + assert_equal expected, formatted + assert formatted.html_safe? + end + + def test_formatted_value_with_html_false + formatted = @format.formatted_value(self, @field, 50, Issue.new, false) + assert_equal '50', formatted + end end end |