aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-06-07 00:31:44 +0200
committersimonbrandhof <simon.brandhof@gmail.com>2011-06-07 00:31:44 +0200
commit37db132ff3d15f738fe50909d018dcf48a3bd17c (patch)
tree20c4644f550bd274a12b5354fec6edb43da797b7
parentd346d2313443339ded7b86bca7765a7ee850a8bb (diff)
downloadsonarqube-37db132ff3d15f738fe50909d018dcf48a3bd17c.tar.gz
sonarqube-37db132ff3d15f738fe50909d018dcf48a3bd17c.zip
Use always the same pattern to display dates and times.
Date must include day of month, abbreviated month name, year. No need for day name or long month name. Time includes hour and minutes only. No need for seconds nor timezone.
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/config/environment.rb10
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/config/locales/en.yml13
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/config/locales/fr.yml10
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/config/locales/ru.yml23
4 files changed, 53 insertions, 3 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/config/environment.rb b/sonar-server/src/main/webapp/WEB-INF/config/environment.rb
index dd9f99e2582..cf15d6a5a31 100644
--- a/sonar-server/src/main/webapp/WEB-INF/config/environment.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/config/environment.rb
@@ -29,9 +29,13 @@ Rails::Initializer.run do |config|
# The internationalization framework can be changed to have another default locale (standard is :en) or more load paths.
# All files from config/locales/*.rb,yml are added automatically.
- # config.i18n.load_path << Dir[File.join(RAILS_ROOT, 'my', 'locales', '*.{rb,yml}')]
- # config.i18n.default_locale = :de
- config.i18n.load_path += Dir[File.join(RAILS_ROOT, 'config', 'locales', '**', '*.{rb,yml}')]
+
+ # Default locales provided by Ruby on Rails
+ config.i18n.load_path << Dir[File.join(RAILS_ROOT, 'config', 'locales', '**', '*.{rb,yml}')]
+
+ # Overridden bundles
+ config.i18n.load_path << Dir[File.join(RAILS_ROOT, 'config', 'locales', '*.{rb,yml}')]
+
config.i18n.default_locale = :en
# Use the database for sessions instead of the cookie-based default,
diff --git a/sonar-server/src/main/webapp/WEB-INF/config/locales/en.yml b/sonar-server/src/main/webapp/WEB-INF/config/locales/en.yml
new file mode 100644
index 00000000000..f164a55f98e
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/config/locales/en.yml
@@ -0,0 +1,13 @@
+# Override default locale
+
+en:
+ date:
+ formats:
+ default: "%d %b %Y"
+
+ time:
+ formats:
+ default: "%d %b %Y %H:%M"
+ am: "am"
+ pm: "pm"
+
diff --git a/sonar-server/src/main/webapp/WEB-INF/config/locales/fr.yml b/sonar-server/src/main/webapp/WEB-INF/config/locales/fr.yml
new file mode 100644
index 00000000000..a74cb73a187
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/config/locales/fr.yml
@@ -0,0 +1,10 @@
+# Override default formats
+
+fr:
+ date:
+ formats:
+ default: "%d %b %Y"
+
+ time:
+ formats:
+ default: "%d %b %Y, %H:%M" \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/config/locales/ru.yml b/sonar-server/src/main/webapp/WEB-INF/config/locales/ru.yml
new file mode 100644
index 00000000000..edd37a02083
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/config/locales/ru.yml
@@ -0,0 +1,23 @@
+# Russian localization for Ruby on Rails 2.2+
+# by Yaroslav Markin <yaroslav@markin.net>
+#
+# Be sure to check out "russian" gem (http://github.com/yaroslav/russian) for
+# full Russian language support in Rails (month names, pluralization, etc).
+# The following is an excerpt from that gem.
+#
+# Для полноценной поддержки русского языка (варианты названий месяцев,
+# плюрализация и так далее) в Rails 2.2 нужно использовать gem "russian"
+# (http://github.com/yaroslav/russian). Следующие данные -- выдержка их него, чтобы
+# была возможность минимальной локализации приложения на русский язык.
+
+ru:
+ date:
+ formats:
+ default: "%d %b %Y"
+
+ time:
+ formats:
+ default: "%d %b %Y, %H:%M"
+
+ am: "утра"
+ pm: "вечера" \ No newline at end of file