diff options
-rw-r--r-- | app/helpers/application_helper.rb | 9 | ||||
-rw-r--r-- | app/views/settings/edit.rhtml | 3 | ||||
-rw-r--r-- | config/settings.yml | 6 | ||||
-rw-r--r-- | lang/bg.yml | 2 | ||||
-rw-r--r-- | lang/de.yml | 2 | ||||
-rw-r--r-- | lang/en.yml | 2 | ||||
-rw-r--r-- | lang/es.yml | 2 | ||||
-rw-r--r-- | lang/fr.yml | 2 | ||||
-rw-r--r-- | lang/it.yml | 2 | ||||
-rw-r--r-- | lang/ja.yml | 2 | ||||
-rw-r--r-- | lang/nl.yml | 2 | ||||
-rw-r--r-- | lang/pt-br.yml | 2 | ||||
-rw-r--r-- | lang/pt.yml | 2 | ||||
-rw-r--r-- | lang/sv.yml | 2 | ||||
-rw-r--r-- | lang/zh.yml | 2 |
15 files changed, 40 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5e3146ca5..7bb809991 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -78,11 +78,16 @@ module ApplicationHelper end def format_date(date) - l_date(date) if date + return nil unless date + @date_format_setting ||= Setting.date_format.to_i + @date_format_setting == 0 ? l_date(date) : date.strftime("%Y-%m-%d") end def format_time(time) - l_datetime((time.is_a? String) ? time.to_time : time) if time + return nil unless time + @date_format_setting ||= Setting.date_format.to_i + time = time.to_time if time.is_a?(String) + @date_format_setting == 0 ? l_datetime(time) : (time.strftime("%Y-%m-%d") + ' ' + l_time(time)) end def day_name(day) diff --git a/app/views/settings/edit.rhtml b/app/views/settings/edit.rhtml index ad068209c..086484935 100644 --- a/app/views/settings/edit.rhtml +++ b/app/views/settings/edit.rhtml @@ -15,6 +15,9 @@ <p><label><%= l(:setting_default_language) %></label> <%= select_tag 'settings[default_language]', options_for_select( lang_options_for_select(false), Setting.default_language) %></p> +<p><label><%= l(:setting_date_format) %></label> +<%= select_tag 'settings[date_format]', options_for_select( [[l(:label_language_based), '0'], ['ISO 8601 (YYYY-MM-DD)', '1']], Setting.date_format) %></p> + <p><label><%= l(:setting_attachment_max_size) %></label> <%= text_field_tag 'settings[attachment_max_size]', Setting.attachment_max_size, :size => 6 %> KB</p> diff --git a/config/settings.yml b/config/settings.yml index 39e2e8531..924f0d3b2 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -66,3 +66,9 @@ commit_fix_status_id: autologin:
format: int
default: 0
+# date format
+# 0: language based
+# 1: ISO format
+date_format:
+ format: int
+ default: 0
diff --git a/lang/bg.yml b/lang/bg.yml index 3d632273e..9fd8b3705 100644 --- a/lang/bg.yml +++ b/lang/bg.yml @@ -172,6 +172,7 @@ setting_sys_api_enabled: Разрешаване на WS за управлени setting_commit_ref_keywords: Отбелязващи ключови думи setting_commit_fix_keywords: Приключващи ключови думи setting_autologin: Autologin +setting_date_format: Date format label_user: Потребител label_user_plural: Потребители @@ -402,6 +403,7 @@ label_month: Month label_week: Week label_date_from: From label_date_to: To +label_language_based: Language based button_login: Вход button_submit: Изпращане diff --git a/lang/de.yml b/lang/de.yml index 03e7002f6..2e7522ce8 100644 --- a/lang/de.yml +++ b/lang/de.yml @@ -172,6 +172,7 @@ setting_sys_api_enabled: Enable WS for repository management setting_commit_ref_keywords: Referencing keywords setting_commit_fix_keywords: Fixing keywords setting_autologin: Autologin +setting_date_format: Date format label_user: Benutzer label_user_plural: Benutzer @@ -402,6 +403,7 @@ label_month: Month label_week: Week label_date_from: From label_date_to: To +label_language_based: Language based button_login: Einloggen button_submit: OK diff --git a/lang/en.yml b/lang/en.yml index e24a2f53f..f6c89d232 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -172,6 +172,7 @@ setting_sys_api_enabled: Enable WS for repository management setting_commit_ref_keywords: Referencing keywords setting_commit_fix_keywords: Fixing keywords setting_autologin: Autologin +setting_date_format: Date format label_user: User label_user_plural: Users @@ -402,6 +403,7 @@ label_month: Month label_week: Week label_date_from: From label_date_to: To +label_language_based: Language based button_login: Login button_submit: Submit diff --git a/lang/es.yml b/lang/es.yml index 8c4a0ba90..d866b8297 100644 --- a/lang/es.yml +++ b/lang/es.yml @@ -172,6 +172,7 @@ setting_sys_api_enabled: Enable WS for repository management setting_commit_ref_keywords: Referencing keywords setting_commit_fix_keywords: Fixing keywords setting_autologin: Autologin +setting_date_format: Date format label_user: Usuario label_user_plural: Usuarios @@ -402,6 +403,7 @@ label_month: Month label_week: Week label_date_from: From label_date_to: To +label_language_based: Language based button_login: Conexión button_submit: Someter diff --git a/lang/fr.yml b/lang/fr.yml index 34449c2ce..788ec2b56 100644 --- a/lang/fr.yml +++ b/lang/fr.yml @@ -172,6 +172,7 @@ setting_sys_api_enabled: Activer les WS pour la gestion des dépôts setting_commit_ref_keywords: Mot-clés de référencement setting_commit_fix_keywords: Mot-clés de résolution setting_autologin: Autologin +setting_date_format: Format de date label_user: Utilisateur label_user_plural: Utilisateurs @@ -402,6 +403,7 @@ label_month: Mois label_week: Semaine label_date_from: Du label_date_to: Au +label_language_based: Basé sur la langue button_login: Connexion button_submit: Soumettre diff --git a/lang/it.yml b/lang/it.yml index 583c3b7c6..74f1c1eaf 100644 --- a/lang/it.yml +++ b/lang/it.yml @@ -172,6 +172,7 @@ setting_sys_api_enabled: Abilita WS per la gestione del repository setting_commit_ref_keywords: Referencing keywords setting_commit_fix_keywords: Fixing keywords setting_autologin: Autologin +setting_date_format: Date format label_user: Utente label_user_plural: Utenti @@ -402,6 +403,7 @@ label_month: Month label_week: Week label_date_from: From label_date_to: To +label_language_based: Language based button_login: Login button_submit: Invia diff --git a/lang/ja.yml b/lang/ja.yml index a7f4b54c3..216e176e8 100644 --- a/lang/ja.yml +++ b/lang/ja.yml @@ -173,6 +173,7 @@ setting_sys_api_enabled: リポジトリ管理用のWeb Serviceを有効化す setting_commit_ref_keywords: 参照用キーワード setting_commit_fix_keywords: 修正用キーワード setting_autologin: 自動ログイン +setting_date_format: Date format label_user: ユーザ label_user_plural: ユーザ @@ -403,6 +404,7 @@ label_month: Month label_week: Week label_date_from: From label_date_to: To +label_language_based: Language based button_login: ログイン button_submit: 変更 diff --git a/lang/nl.yml b/lang/nl.yml index 34b6897ca..a71c496b0 100644 --- a/lang/nl.yml +++ b/lang/nl.yml @@ -172,6 +172,7 @@ setting_sys_api_enabled: Gebruik WS voor repository beheer setting_commit_ref_keywords: Referencing keywords setting_commit_fix_keywords: Fixing keywords setting_autologin: Autologin +setting_date_format: Date format label_user: Gebruiker label_user_plural: Gebruikers @@ -402,6 +403,7 @@ label_month: Month label_week: Week label_date_from: From label_date_to: To +label_language_based: Language based button_login: Inloggen button_submit: Toevoegen diff --git a/lang/pt-br.yml b/lang/pt-br.yml index c37027883..21d08d059 100644 --- a/lang/pt-br.yml +++ b/lang/pt-br.yml @@ -172,6 +172,7 @@ setting_sys_api_enabled: Ativa WS para gerenciamento do repositorio setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin
+setting_date_format: Date format
label_user: Usuario
label_user_plural: Usuarios
@@ -402,6 +403,7 @@ label_month: Month label_week: Week
label_date_from: From
label_date_to: To
+label_language_based: Language based
button_login: Login
button_submit: Enviar
diff --git a/lang/pt.yml b/lang/pt.yml index 09236a347..2c1fe9f17 100644 --- a/lang/pt.yml +++ b/lang/pt.yml @@ -172,6 +172,7 @@ setting_sys_api_enabled: Ativa WS para gerenciamento do repositório setting_commit_ref_keywords: Palavras-chave de referôncia setting_commit_fix_keywords: Palavras-chave fixas setting_autologin: Autologin +setting_date_format: Date format label_user: Usuário label_user_plural: Usuários @@ -402,6 +403,7 @@ label_month: Month label_week: Week label_date_from: From label_date_to: To +label_language_based: Language based button_login: Login button_submit: Enviar diff --git a/lang/sv.yml b/lang/sv.yml index f56ef2ef2..4f0003698 100644 --- a/lang/sv.yml +++ b/lang/sv.yml @@ -172,6 +172,7 @@ setting_sys_api_enabled: Aktivera WS för repository management setting_commit_ref_keywords: Referencing keywords setting_commit_fix_keywords: Fixing keywords setting_autologin: Autologin +setting_date_format: Date format label_user: Användare label_user_plural: Användare @@ -402,6 +403,7 @@ label_month: Month label_week: Week label_date_from: From label_date_to: To +label_language_based: Language based button_login: Logga in button_submit: Skicka diff --git a/lang/zh.yml b/lang/zh.yml index 850c9b56e..88dfdca44 100644 --- a/lang/zh.yml +++ b/lang/zh.yml @@ -175,6 +175,7 @@ setting_sys_api_enabled: Enable WS for repository management setting_commit_ref_keywords: Referencing keywords setting_commit_fix_keywords: Fixing keywords setting_autologin: Autologin +setting_date_format: Date format label_user: 用户 label_user_plural: 用户列表 @@ -404,6 +405,7 @@ label_month: Month label_week: Week label_date_from: From label_date_to: To +label_language_based: Language based button_login: 登录 button_submit: 提交 |