scm: use i18n string at commit log encoding setting (#1735).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5519 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
d67e4ff2f4
commit
bb929f4f75
|
@ -201,8 +201,9 @@ module RepositoriesHelper
|
||||||
content_tag('p', form.text_field(:url, :label => 'Root directory',
|
content_tag('p', form.text_field(:url, :label => 'Root directory',
|
||||||
:size => 60, :required => true,
|
:size => 60, :required => true,
|
||||||
:disabled => (repository && !repository.new_record?))) +
|
:disabled => (repository && !repository.new_record?))) +
|
||||||
content_tag('p', form.select(:log_encoding, [nil] + Setting::ENCODINGS,
|
content_tag('p', form.select(
|
||||||
:label => 'Commit messages encoding', :required => true))
|
:log_encoding, [nil] + Setting::ENCODINGS,
|
||||||
|
:label => l("field_commit_logs_encoding"), :required => true))
|
||||||
end
|
end
|
||||||
|
|
||||||
def mercurial_field_tags(form, repository)
|
def mercurial_field_tags(form, repository)
|
||||||
|
@ -234,8 +235,9 @@ module RepositoriesHelper
|
||||||
content_tag('p', form.text_field(:url, :label => 'Module',
|
content_tag('p', form.text_field(:url, :label => 'Module',
|
||||||
:size => 30, :required => true,
|
:size => 30, :required => true,
|
||||||
:disabled => !repository.new_record?)) +
|
:disabled => !repository.new_record?)) +
|
||||||
content_tag('p', form.select(:log_encoding, [nil] + Setting::ENCODINGS,
|
content_tag('p', form.select(
|
||||||
:label => 'Commit messages encoding', :required => true)) +
|
:log_encoding, [nil] + Setting::ENCODINGS,
|
||||||
|
:label => l("field_commit_logs_encoding"), :required => true)) +
|
||||||
content_tag('p', form.select(
|
content_tag('p', form.select(
|
||||||
:path_encoding, [nil] + Setting::ENCODINGS,
|
:path_encoding, [nil] + Setting::ENCODINGS,
|
||||||
:label => 'Path encoding') +
|
:label => 'Path encoding') +
|
||||||
|
@ -246,8 +248,9 @@ module RepositoriesHelper
|
||||||
content_tag('p', form.text_field(:url, :label => 'Root directory',
|
content_tag('p', form.text_field(:url, :label => 'Root directory',
|
||||||
:size => 60, :required => true,
|
:size => 60, :required => true,
|
||||||
:disabled => (repository && !repository.new_record?))) +
|
:disabled => (repository && !repository.new_record?))) +
|
||||||
content_tag('p', form.select(:log_encoding, [nil] + Setting::ENCODINGS,
|
content_tag('p', form.select(
|
||||||
:label => 'Commit messages encoding', :required => true))
|
:log_encoding, [nil] + Setting::ENCODINGS,
|
||||||
|
:label => l("field_commit_logs_encoding"), :required => true))
|
||||||
end
|
end
|
||||||
|
|
||||||
def filesystem_field_tags(form, repository)
|
def filesystem_field_tags(form, repository)
|
||||||
|
|
|
@ -30,6 +30,14 @@ class Repository < ActiveRecord::Base
|
||||||
# Checks if the SCM is enabled when creating a repository
|
# Checks if the SCM is enabled when creating a repository
|
||||||
validate_on_create { |r| r.errors.add(:type, :invalid) unless Setting.enabled_scm.include?(r.class.name.demodulize) }
|
validate_on_create { |r| r.errors.add(:type, :invalid) unless Setting.enabled_scm.include?(r.class.name.demodulize) }
|
||||||
|
|
||||||
|
def self.human_attribute_name(attribute_key_name)
|
||||||
|
attr_name = attribute_key_name
|
||||||
|
if attr_name == "log_encoding"
|
||||||
|
attr_name = "commit_logs_encoding"
|
||||||
|
end
|
||||||
|
super(attr_name)
|
||||||
|
end
|
||||||
|
|
||||||
# Removes leading and trailing whitespace
|
# Removes leading and trailing whitespace
|
||||||
def url=(arg)
|
def url=(arg)
|
||||||
write_attribute(:url, arg ? arg.to_s.strip : nil)
|
write_attribute(:url, arg ? arg.to_s.strip : nil)
|
||||||
|
|
|
@ -23,7 +23,6 @@ class Repository::Bazaar < Repository
|
||||||
|
|
||||||
ATTRIBUTE_KEY_NAMES = {
|
ATTRIBUTE_KEY_NAMES = {
|
||||||
"url" => "Root directory",
|
"url" => "Root directory",
|
||||||
"log_encoding" => "Commit messages encoding",
|
|
||||||
}
|
}
|
||||||
def self.human_attribute_name(attribute_key_name)
|
def self.human_attribute_name(attribute_key_name)
|
||||||
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
|
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
|
||||||
|
|
|
@ -24,7 +24,6 @@ class Repository::Cvs < Repository
|
||||||
ATTRIBUTE_KEY_NAMES = {
|
ATTRIBUTE_KEY_NAMES = {
|
||||||
"root_url" => "CVSROOT",
|
"root_url" => "CVSROOT",
|
||||||
"url" => "Module",
|
"url" => "Module",
|
||||||
"log_encoding" => "Commit messages encoding",
|
|
||||||
}
|
}
|
||||||
def self.human_attribute_name(attribute_key_name)
|
def self.human_attribute_name(attribute_key_name)
|
||||||
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
|
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
|
||||||
|
|
|
@ -22,7 +22,6 @@ class Repository::Darcs < Repository
|
||||||
|
|
||||||
ATTRIBUTE_KEY_NAMES = {
|
ATTRIBUTE_KEY_NAMES = {
|
||||||
"url" => "Root directory",
|
"url" => "Root directory",
|
||||||
"log_encoding" => "Commit messages encoding",
|
|
||||||
}
|
}
|
||||||
def self.human_attribute_name(attribute_key_name)
|
def self.human_attribute_name(attribute_key_name)
|
||||||
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
|
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
|
||||||
|
|
Loading…
Reference in New Issue