summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-23 03:34:43 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-23 03:34:43 +0000
commitbb929f4f7501fc0480e7d8818c89f870d09b5244 (patch)
tree04326bb80f3155e9c1346de9f124632ceb996ecc /app
parentd67e4ff2f47834026132bf2cc9a743e6f47e669a (diff)
downloadredmine-bb929f4f7501fc0480e7d8818c89f870d09b5244.tar.gz
redmine-bb929f4f7501fc0480e7d8818c89f870d09b5244.zip
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
Diffstat (limited to 'app')
-rw-r--r--app/helpers/repositories_helper.rb15
-rw-r--r--app/models/repository.rb8
-rw-r--r--app/models/repository/bazaar.rb1
-rw-r--r--app/models/repository/cvs.rb1
-rw-r--r--app/models/repository/darcs.rb1
5 files changed, 17 insertions, 9 deletions
diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb
index f15980224..71021571c 100644
--- a/app/helpers/repositories_helper.rb
+++ b/app/helpers/repositories_helper.rb
@@ -201,8 +201,9 @@ module RepositoriesHelper
content_tag('p', form.text_field(:url, :label => 'Root directory',
:size => 60, :required => true,
:disabled => (repository && !repository.new_record?))) +
- content_tag('p', form.select(:log_encoding, [nil] + Setting::ENCODINGS,
- :label => 'Commit messages encoding', :required => true))
+ content_tag('p', form.select(
+ :log_encoding, [nil] + Setting::ENCODINGS,
+ :label => l("field_commit_logs_encoding"), :required => true))
end
def mercurial_field_tags(form, repository)
@@ -234,8 +235,9 @@ module RepositoriesHelper
content_tag('p', form.text_field(:url, :label => 'Module',
:size => 30, :required => true,
:disabled => !repository.new_record?)) +
- content_tag('p', form.select(:log_encoding, [nil] + Setting::ENCODINGS,
- :label => 'Commit messages encoding', :required => true)) +
+ content_tag('p', form.select(
+ :log_encoding, [nil] + Setting::ENCODINGS,
+ :label => l("field_commit_logs_encoding"), :required => true)) +
content_tag('p', form.select(
:path_encoding, [nil] + Setting::ENCODINGS,
:label => 'Path encoding') +
@@ -246,8 +248,9 @@ module RepositoriesHelper
content_tag('p', form.text_field(:url, :label => 'Root directory',
:size => 60, :required => true,
:disabled => (repository && !repository.new_record?))) +
- content_tag('p', form.select(:log_encoding, [nil] + Setting::ENCODINGS,
- :label => 'Commit messages encoding', :required => true))
+ content_tag('p', form.select(
+ :log_encoding, [nil] + Setting::ENCODINGS,
+ :label => l("field_commit_logs_encoding"), :required => true))
end
def filesystem_field_tags(form, repository)
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 5cb27c920..3a0b6f911 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -30,6 +30,14 @@ class Repository < ActiveRecord::Base
# 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) }
+ 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
def url=(arg)
write_attribute(:url, arg ? arg.to_s.strip : nil)
diff --git a/app/models/repository/bazaar.rb b/app/models/repository/bazaar.rb
index 3ae8b28fe..481c52033 100644
--- a/app/models/repository/bazaar.rb
+++ b/app/models/repository/bazaar.rb
@@ -23,7 +23,6 @@ class Repository::Bazaar < Repository
ATTRIBUTE_KEY_NAMES = {
"url" => "Root directory",
- "log_encoding" => "Commit messages encoding",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
diff --git a/app/models/repository/cvs.rb b/app/models/repository/cvs.rb
index 4c8d8034f..84f617600 100644
--- a/app/models/repository/cvs.rb
+++ b/app/models/repository/cvs.rb
@@ -24,7 +24,6 @@ class Repository::Cvs < Repository
ATTRIBUTE_KEY_NAMES = {
"root_url" => "CVSROOT",
"url" => "Module",
- "log_encoding" => "Commit messages encoding",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
diff --git a/app/models/repository/darcs.rb b/app/models/repository/darcs.rb
index e1f9f7eea..ca38be4da 100644
--- a/app/models/repository/darcs.rb
+++ b/app/models/repository/darcs.rb
@@ -22,7 +22,6 @@ class Repository::Darcs < Repository
ATTRIBUTE_KEY_NAMES = {
"url" => "Root directory",
- "log_encoding" => "Commit messages encoding",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super