From 11ea16a91ad0179b55d4ded2081e0beda699c93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Tue, 19 Jan 2016 17:14:45 +0100 Subject: [PATCH] FIX: localize S3 region names --- app/models/s3_region_site_setting.rb | 9 +++++++-- config/locales/client.en.yml | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/models/s3_region_site_setting.rb b/app/models/s3_region_site_setting.rb index 90f52ae4f..24710f89a 100644 --- a/app/models/s3_region_site_setting.rb +++ b/app/models/s3_region_site_setting.rb @@ -6,7 +6,7 @@ class S3RegionSiteSetting < EnumSiteSetting end def self.values - @values ||= valid_values.sort.map { |x| { name: x, value: x } } + @values ||= valid_values.sort.map { |x| { name: "s3.regions.#{x.tr("-", "_")}", value: x } } end def self.valid_values @@ -20,7 +20,12 @@ class S3RegionSiteSetting < EnumSiteSetting 'ap-southeast-2', 'ap-northeast-1', 'ap-northeast-2', - 'sa-east-1'] + 'sa-east-1' + ] + end + + def self.translate_names? + true end private_class_method :valid_values diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 965269df6..77b13ca62 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -145,6 +145,20 @@ en: emails_are_disabled: "All outgoing email has been globally disabled by an administrator. No email notifications of any kind will be sent." + s3: + regions: + us_east_1: "US East (N. Virginia)" + us_west_1: "US West (N. California)" + us_west_2: "US West (Oregon)" + us_gov_west_1: "AWS GovCloud (US)" + eu_west_1: "EU (Ireland)" + eu_central_1: "EU (Frankfurt)" + ap_southeast_1: "Asia Pacific (Singapore)" + ap_southeast_2: "Asia Pacific (Sydney)" + ap_northeast_1: "Asia Pacific (Tokyo)" + ap_northeast_2: "Asia Pacific (Seoul)" + sa_east_1: "South America (Sao Paulo)" + edit: 'edit the title and category of this topic' not_implemented: "That feature hasn't been implemented yet, sorry!" no_value: "No"