From 7e77d5ddf9f7024fb37fc859a24f6e359547c40a Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 23 Apr 2011 07:40:23 +0000 Subject: [PATCH] scm: cvs: use i18n string at 'CVSROOT' and 'Module' setting. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5535 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/repositories_helper.rb | 10 +++++++--- app/models/repository/cvs.rb | 12 +++++++----- config/locales/en.yml | 2 ++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 10e39c819..f36a54cdd 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -236,10 +236,14 @@ module RepositoriesHelper end def cvs_field_tags(form, repository) - content_tag('p', form.text_field(:root_url, - :label => 'CVSROOT', :size => 60, :required => true, + content_tag('p', form.text_field( + :root_url, + :label => l("field_cvsroot"), + :size => 60, :required => true, :disabled => !repository.new_record?)) + - content_tag('p', form.text_field(:url, :label => 'Module', + content_tag('p', form.text_field( + :url, + :label => l("field_cvs_module"), :size => 30, :required => true, :disabled => !repository.new_record?)) + content_tag('p', form.select( diff --git a/app/models/repository/cvs.rb b/app/models/repository/cvs.rb index 84f617600..5a138d6e0 100644 --- a/app/models/repository/cvs.rb +++ b/app/models/repository/cvs.rb @@ -21,12 +21,14 @@ require 'digest/sha1' class Repository::Cvs < Repository validates_presence_of :url, :root_url, :log_encoding - ATTRIBUTE_KEY_NAMES = { - "root_url" => "CVSROOT", - "url" => "Module", - } def self.human_attribute_name(attribute_key_name) - ATTRIBUTE_KEY_NAMES[attribute_key_name] || super + attr_name = attribute_key_name + if attr_name == "root_url" + attr_name = "cvsroot" + elsif attr_name == "url" + attr_name = "cvs_module" + end + super(attr_name) end def self.scm_adapter_class diff --git a/config/locales/en.yml b/config/locales/en.yml index 190d333f6..7ea23ec2f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -313,6 +313,8 @@ en: field_scm_path_encoding: Path encoding field_path_to_repository: Path to repository field_root_directory: Root directory + field_cvsroot: CVSROOT + field_cvs_module: Module setting_app_title: Application title setting_app_subtitle: Application subtitle