]> source.dussan.org Git - redmine.git/commitdiff
scm: use i18n string at 'Path to repository' setting in Mercurial, Git, Bazaar and...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 23 Apr 2011 07:37:03 +0000 (07:37 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 23 Apr 2011 07:37:03 +0000 (07:37 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5529 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/repositories_helper.rb
app/models/repository/bazaar.rb
app/models/repository/darcs.rb
app/models/repository/git.rb
app/models/repository/mercurial.rb
config/locales/en.yml

index 1c7d47620c906de61ba2e7e897dc4881ac08e3a0..f260320de3f717506859c473d33e4cd4e0a55cec 100644 (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(
index a4c39b47134eb60b238611bb3d7171385af5f362..3248331afc66822be0da7757ad6ff38856584cd6 100644 (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
index f6f85e3a36314afcba195113000991018bca22cd..966be33a94f5dd698d02e4f800d093a017dfa713 100644 (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
index 13621f6534775836e53493dd994719b751db82fe..43ee72bee1023e731a34a2e9a7830d15a8d71a21 100644 (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
index 4cf484f964a58ecd939eb5b6624364c512cbdea9..4d32d6f51ba0e93880cdd7b73f4c3dc6cbc44642 100644 (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
index 5eb47d3f8efc82824dfe41fe0ef706c480b67105..f53a1c1f984004b12d9952477a3382a01eba83b1 100644 (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