scm: use i18n string at 'Path to repository' setting in Mercurial, Git, Bazaar and Darcs.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5529 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-04-23 07:37:03 +00:00
parent 82d5de4b4e
commit 36eac0dc8d
6 changed files with 31 additions and 22 deletions

View File

@ -198,7 +198,8 @@ module RepositoriesHelper
end
def darcs_field_tags(form, repository)
content_tag('p', form.text_field(:url, :label => 'Path to repository',
content_tag('p', form.text_field(
:url, :label => l("field_path_to_repository"),
:size => 60, :required => true,
:disabled => (repository && !repository.new_record?))) +
content_tag('p', form.select(
@ -208,7 +209,7 @@ module RepositoriesHelper
def mercurial_field_tags(form, repository)
content_tag('p', form.text_field(
:url, :label => 'Path to repository',
:url, :label => l("field_path_to_repository"),
:size => 60, :required => true,
:disabled => (repository && !repository.root_url.blank?)
) +
@ -221,10 +222,12 @@ module RepositoriesHelper
end
def git_field_tags(form, repository)
content_tag('p', form.text_field(:url, :label => 'Path to repository',
content_tag('p', form.text_field(
:url, :label => l("field_path_to_repository"),
:size => 60, :required => true,
:disabled => (repository && !repository.root_url.blank?)) +
'<br />Bare and local repository (e.g. /gitrepo, c:\gitrepo)') +
:disabled => (repository && !repository.root_url.blank?)
) +
'<br />Bare and local repository (e.g. /gitrepo, c:\gitrepo)') +
content_tag('p', form.select(
:path_encoding, [nil] + Setting::ENCODINGS,
:label => l("field_scm_path_encoding")
@ -250,7 +253,8 @@ module RepositoriesHelper
end
def bazaar_field_tags(form, repository)
content_tag('p', form.text_field(:url, :label => 'Path to repository',
content_tag('p', form.text_field(
:url, :label => l("field_path_to_repository"),
:size => 60, :required => true,
:disabled => (repository && !repository.new_record?))) +
content_tag('p', form.select(

View File

@ -21,11 +21,12 @@ class Repository::Bazaar < Repository
attr_protected :root_url
validates_presence_of :url, :log_encoding
ATTRIBUTE_KEY_NAMES = {
"url" => "Path to repository",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
attr_name = attribute_key_name
if attr_name == "url"
attr_name = "path_to_repository"
end
super(attr_name)
end
def self.scm_adapter_class

View File

@ -20,11 +20,12 @@ require 'redmine/scm/adapters/darcs_adapter'
class Repository::Darcs < Repository
validates_presence_of :url, :log_encoding
ATTRIBUTE_KEY_NAMES = {
"url" => "Path to repository",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
attr_name = attribute_key_name
if attr_name == "url"
attr_name = "path_to_repository"
end
super(attr_name)
end
def self.scm_adapter_class

View File

@ -21,11 +21,12 @@ class Repository::Git < Repository
attr_protected :root_url
validates_presence_of :url
ATTRIBUTE_KEY_NAMES = {
"url" => "Path to repository",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
attr_name = attribute_key_name
if attr_name == "url"
attr_name = "path_to_repository"
end
super(attr_name)
end
def self.scm_adapter_class

View File

@ -26,11 +26,12 @@ class Repository::Mercurial < Repository
FETCH_AT_ONCE = 100 # number of changesets to fetch at once
ATTRIBUTE_KEY_NAMES = {
"url" => "Path to repository",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
attr_name = attribute_key_name
if attr_name == "url"
attr_name = "path_to_repository"
end
super(attr_name)
end
def self.scm_adapter_class

View File

@ -311,6 +311,7 @@ en:
field_is_private: Private
field_commit_logs_encoding: Commit messages encoding
field_scm_path_encoding: Path encoding
field_path_to_repository: Path to repository
setting_app_title: Application title
setting_app_subtitle: Application subtitle