summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-06-26 19:46:57 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-06-26 19:46:57 +0000
commita4a8b6381e4a162da85319e216a770ee7bd82202 (patch)
tree9db63e7eb87f36981ab4b551e9df0c4658d530ff
parent864ac367e85160b523b2f05522cbf0d3f2d65c0d (diff)
downloadredmine-a4a8b6381e4a162da85319e216a770ee7bd82202.tar.gz
redmine-a4a8b6381e4a162da85319e216a770ee7bd82202.zip
Adds a key in lang files (general_csv_decimal_separator) to set the decimal separator (point or comma) in csv exports (#1372).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1591 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/helpers/issues_helper.rb3
-rw-r--r--app/helpers/timelog_helper.rb3
-rw-r--r--lang/bg.yml1
-rw-r--r--lang/cs.yml1
-rw-r--r--lang/da.yml1
-rw-r--r--lang/de.yml1
-rw-r--r--lang/en.yml1
-rw-r--r--lang/es.yml1
-rw-r--r--lang/fi.yml1
-rw-r--r--lang/fr.yml1
-rw-r--r--lang/he.yml1
-rw-r--r--lang/hu.yml1
-rw-r--r--lang/it.yml1
-rw-r--r--lang/ja.yml1
-rw-r--r--lang/ko.yml1
-rw-r--r--lang/lt.yml1
-rw-r--r--lang/nl.yml1
-rw-r--r--lang/no.yml1
-rw-r--r--lang/pl.yml1
-rw-r--r--lang/pt-br.yml1
-rw-r--r--lang/pt.yml1
-rw-r--r--lang/ro.yml1
-rw-r--r--lang/ru.yml1
-rw-r--r--lang/sr.yml1
-rw-r--r--lang/sv.yml1
-rw-r--r--lang/th.yml1
-rw-r--r--lang/uk.yml1
-rw-r--r--lang/zh-tw.yml1
-rw-r--r--lang/zh.yml1
29 files changed, 31 insertions, 2 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index e8f21e9a4..f42002ec8 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -126,6 +126,7 @@ module IssuesHelper
def issues_to_csv(issues, project = nil)
ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')
+ decimal_separator = l(:general_csv_decimal_separator)
export = StringIO.new
CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
# csv header fields
@@ -168,7 +169,7 @@ module IssuesHelper
format_date(issue.start_date),
format_date(issue.due_date),
issue.done_ratio,
- issue.estimated_hours,
+ issue.estimated_hours.to_s.gsub('.', decimal_separator),
format_time(issue.created_on),
format_time(issue.updated_on)
]
diff --git a/app/helpers/timelog_helper.rb b/app/helpers/timelog_helper.rb
index db13556a1..7fd70e744 100644
--- a/app/helpers/timelog_helper.rb
+++ b/app/helpers/timelog_helper.rb
@@ -44,6 +44,7 @@ module TimelogHelper
def entries_to_csv(entries)
ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')
+ decimal_separator = l(:general_csv_decimal_separator)
export = StringIO.new
CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
# csv header fields
@@ -67,7 +68,7 @@ module TimelogHelper
(entry.issue ? entry.issue.id : nil),
(entry.issue ? entry.issue.tracker : nil),
(entry.issue ? entry.issue.subject : nil),
- entry.hours,
+ entry.hours.to_s.gsub('.', decimal_separator),
entry.comments
]
csv << fields.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
diff --git a/lang/bg.yml b/lang/bg.yml
index 1339d9a83..fd6e7e6cf 100644
--- a/lang/bg.yml
+++ b/lang/bg.yml
@@ -48,6 +48,7 @@ general_text_no: 'не'
general_text_yes: 'да'
general_lang_name: 'Bulgarian'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: UTF-8
general_pdf_encoding: UTF-8
general_day_names: Понеделник,Вторник,Сряда,Четвъртък,Петък,Събота,Неделя
diff --git a/lang/cs.yml b/lang/cs.yml
index 00d0642de..2c760722b 100644
--- a/lang/cs.yml
+++ b/lang/cs.yml
@@ -51,6 +51,7 @@ general_text_no: 'ne'
general_text_yes: 'ano'
general_lang_name: 'Čeština'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: UTF-8
general_pdf_encoding: UTF-8
general_day_names: Pondělí,Úterý,Středa,Čtvrtek,Pátek,Sobota,Neděle
diff --git a/lang/da.yml b/lang/da.yml
index b8546ab20..d51d30817 100644
--- a/lang/da.yml
+++ b/lang/da.yml
@@ -48,6 +48,7 @@ general_text_no: 'nej'
general_text_yes: 'ja'
general_lang_name: 'Danish (Dansk)'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: ISO-8859-1
general_pdf_encoding: ISO-8859-1
general_day_names: Mandag,Tirsdag,Onsdag,Torsdag,Fredag,Lørdag,Søndag
diff --git a/lang/de.yml b/lang/de.yml
index 6bc7919f9..2bc0a16f7 100644
--- a/lang/de.yml
+++ b/lang/de.yml
@@ -48,6 +48,7 @@ general_text_no: 'nein'
general_text_yes: 'ja'
general_lang_name: 'Deutsch'
general_csv_separator: ';'
+general_csv_decimal_separator: ','
general_csv_encoding: ISO-8859-1
general_pdf_encoding: ISO-8859-1
general_day_names: Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag,Sonntag
diff --git a/lang/en.yml b/lang/en.yml
index 7ab73f051..180a70565 100644
--- a/lang/en.yml
+++ b/lang/en.yml
@@ -48,6 +48,7 @@ general_text_no: 'no'
general_text_yes: 'yes'
general_lang_name: 'English'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: ISO-8859-1
general_pdf_encoding: ISO-8859-1
general_day_names: Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday
diff --git a/lang/es.yml b/lang/es.yml
index 2615d8f61..44d48190b 100644
--- a/lang/es.yml
+++ b/lang/es.yml
@@ -48,6 +48,7 @@ general_text_no: 'no'
general_text_yes: 'sí'
general_lang_name: 'Español'
general_csv_separator: ';'
+general_csv_decimal_separator: ','
general_csv_encoding: ISO-8859-15
general_pdf_encoding: ISO-8859-15
general_day_names: Lunes,Martes,Miércoles,Jueves,Viernes,Sábado,Domingo
diff --git a/lang/fi.yml b/lang/fi.yml
index 51b0c04a0..ad719dd6c 100644
--- a/lang/fi.yml
+++ b/lang/fi.yml
@@ -48,6 +48,7 @@ general_text_no: 'ei'
general_text_yes: 'kyllä'
general_lang_name: 'Finnish (Suomi)'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: ISO-8859-1
general_pdf_encoding: ISO-8859-1
general_day_names: Maanantai,Tiistai,Keskiviikko,Torstai,Perjantai,Lauantai,Sunnuntai
diff --git a/lang/fr.yml b/lang/fr.yml
index 1fd86dd07..89b0b4c86 100644
--- a/lang/fr.yml
+++ b/lang/fr.yml
@@ -48,6 +48,7 @@ general_text_no: 'non'
general_text_yes: 'oui'
general_lang_name: 'Français'
general_csv_separator: ';'
+general_csv_decimal_separator: ','
general_csv_encoding: ISO-8859-1
general_pdf_encoding: ISO-8859-1
general_day_names: Lundi,Mardi,Mercredi,Jeudi,Vendredi,Samedi,Dimanche
diff --git a/lang/he.yml b/lang/he.yml
index 7455fc395..501cfdc9b 100644
--- a/lang/he.yml
+++ b/lang/he.yml
@@ -48,6 +48,7 @@ general_text_no: 'לא'
general_text_yes: 'כן'
general_lang_name: 'Hebrew (עברית)'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: ISO-8859-8-I
general_pdf_encoding: ISO-8859-8-I
general_day_names: שני,שלישי,רביעי,חמישי,שישי,שבת,ראשון
diff --git a/lang/hu.yml b/lang/hu.yml
index 1810e93d8..6f88eb962 100644
--- a/lang/hu.yml
+++ b/lang/hu.yml
@@ -48,6 +48,7 @@ general_text_no: 'nem'
general_text_yes: 'igen'
general_lang_name: 'Magyar'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: ISO-8859-2
general_pdf_encoding: ISO-8859-2
general_day_names: Hétfő,Kedd,Szerda,Csütörtök,Péntek,Szombat,Vasárnap
diff --git a/lang/it.yml b/lang/it.yml
index 867c73f9a..14dc86fff 100644
--- a/lang/it.yml
+++ b/lang/it.yml
@@ -48,6 +48,7 @@ general_text_no: 'no'
general_text_yes: 'si'
general_lang_name: 'Italiano'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: ISO-8859-1
general_pdf_encoding: ISO-8859-1
general_day_names: Lunedì,Martedì,Mercoledì,Giovedì,Venerdì,Sabato,Domenica
diff --git a/lang/ja.yml b/lang/ja.yml
index aa4320c3a..5bdc3b554 100644
--- a/lang/ja.yml
+++ b/lang/ja.yml
@@ -49,6 +49,7 @@ general_text_no: 'いいえ'
general_text_yes: 'はい'
general_lang_name: 'Japanese (日本語)'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: SJIS
general_pdf_encoding: UTF-8
general_day_names: 月曜日,火曜日,水曜日,木曜日,金曜日,土曜日,日曜日
diff --git a/lang/ko.yml b/lang/ko.yml
index f945537a9..8e0d35ef4 100644
--- a/lang/ko.yml
+++ b/lang/ko.yml
@@ -48,6 +48,7 @@ general_text_no: '아니오'
general_text_yes: '예'
general_lang_name: 'Korean (한국어)'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: CP949
general_pdf_encoding: CP949
general_day_names: 월요일,화요일,수요일,목요일,금요일,토요일,일요일
diff --git a/lang/lt.yml b/lang/lt.yml
index 355f473c8..df2e2b471 100644
--- a/lang/lt.yml
+++ b/lang/lt.yml
@@ -48,6 +48,7 @@ general_text_no: 'ne'
general_text_yes: 'taip'
general_lang_name: 'Lithuanian (lietuvių)'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: UTF-8
general_pdf_encoding: UTF-8
general_day_names: pirmadienis,antradienis,trečiadienis,ketvirtadienis,penktadienis,šeštadienis,sekmadienis
diff --git a/lang/nl.yml b/lang/nl.yml
index 89b8a5736..d1facc7a6 100644
--- a/lang/nl.yml
+++ b/lang/nl.yml
@@ -48,6 +48,7 @@ general_text_no: 'nee'
general_text_yes: 'ja'
general_lang_name: 'Nederlands'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: ISO-8859-1
general_pdf_encoding: ISO-8859-1
general_day_names: Maandag, Dinsdag, Woensdag, Donderdag, Vrijdag, Zaterdag, Zondag
diff --git a/lang/no.yml b/lang/no.yml
index 5e4bdcca3..bf25a15a5 100644
--- a/lang/no.yml
+++ b/lang/no.yml
@@ -48,6 +48,7 @@ general_text_no: 'nei'
general_text_yes: 'ja'
general_lang_name: 'Norwegian (Norsk bokmål)'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: ISO-8859-1
general_pdf_encoding: ISO-8859-1
general_day_names: Mandag,Tirsdag,Onsdag,Torsdag,Fredag,Lørdag,Søndag
diff --git a/lang/pl.yml b/lang/pl.yml
index 0b0f87b6f..28c5f19d4 100644
--- a/lang/pl.yml
+++ b/lang/pl.yml
@@ -48,6 +48,7 @@ general_text_no: 'nie'
general_text_yes: 'tak'
general_lang_name: 'Polski'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: ISO-8859-2
general_pdf_encoding: ISO-8859-2
general_day_names: Poniedziałek,Wtorek,Środa,Czwartek,Piątek,Sobota,Niedziela
diff --git a/lang/pt-br.yml b/lang/pt-br.yml
index e2036afde..04c3b347c 100644
--- a/lang/pt-br.yml
+++ b/lang/pt-br.yml
@@ -48,6 +48,7 @@ general_text_no: 'não'
general_text_yes: 'sim'
general_lang_name: 'Português(Brasil)'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: ISO-8859-1
general_pdf_encoding: ISO-8859-1
general_day_names: Segunda,Terça,Quarta,Quinta,Sexta,Sabado,Domingo
diff --git a/lang/pt.yml b/lang/pt.yml
index 543743cab..5a1ffc2e0 100644
--- a/lang/pt.yml
+++ b/lang/pt.yml
@@ -48,6 +48,7 @@ general_text_no: 'não'
general_text_yes: 'sim'
general_lang_name: 'Português'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: ISO-8859-1
general_pdf_encoding: ISO-8859-1
general_day_names: Segunda,Terça,Quarta,Quinta,Sexta,Sábado,Domingo
diff --git a/lang/ro.yml b/lang/ro.yml
index 16c2ea104..3a1696c7b 100644
--- a/lang/ro.yml
+++ b/lang/ro.yml
@@ -48,6 +48,7 @@ general_text_no: 'nu'
general_text_yes: 'da'
general_lang_name: 'Română'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: ISO-8859-1
general_pdf_encoding: ISO-8859-1
general_day_names: Luni,Marti,Miercuri,Joi,Vineri,Sambata,Duminica
diff --git a/lang/ru.yml b/lang/ru.yml
index 10ea1aad6..7d0707f7f 100644
--- a/lang/ru.yml
+++ b/lang/ru.yml
@@ -48,6 +48,7 @@ general_text_no: 'Нет'
general_text_yes: 'Да'
general_lang_name: 'Russian (Русский)'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: UTF-8
general_pdf_encoding: UTF-8
general_day_names: Понедельник,Вторник,Среда,Четверг,Пятница,Суббота,Воскресенье
diff --git a/lang/sr.yml b/lang/sr.yml
index 83bfdf43c..5b8e5d934 100644
--- a/lang/sr.yml
+++ b/lang/sr.yml
@@ -48,6 +48,7 @@ general_text_no: 'ne'
general_text_yes: 'da'
general_lang_name: 'Srpski'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: ISO-8859-1
general_pdf_encoding: ISO-8859-1
general_day_names: Ponedeljak, Utorak, Sreda, četvrtak, Petak, Subota, Nedelja
diff --git a/lang/sv.yml b/lang/sv.yml
index 375970f3e..4c6170f4a 100644
--- a/lang/sv.yml
+++ b/lang/sv.yml
@@ -48,6 +48,7 @@ general_text_no: 'nej'
general_text_yes: 'ja'
general_lang_name: 'Svenska'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: ISO-8859-1
general_pdf_encoding: ISO-8859-1
general_day_names: Måndag,Tisdag,Onsdag,Torsdag,Fredag,Lördag,Söndag
diff --git a/lang/th.yml b/lang/th.yml
index acbf146cf..e7f276a34 100644
--- a/lang/th.yml
+++ b/lang/th.yml
@@ -48,6 +48,7 @@ general_text_no: 'ไม่'
general_text_yes: 'ใช่'
general_lang_name: 'Thai (ไทย)'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: Windows-874
general_pdf_encoding: cp874
general_day_names: จันทร์,อังคาร,พุธ,พฤหัสบดี,ศุกร์,เสาร์,อาทิตย์
diff --git a/lang/uk.yml b/lang/uk.yml
index d70916b1e..275de0e4b 100644
--- a/lang/uk.yml
+++ b/lang/uk.yml
@@ -48,6 +48,7 @@ general_text_no: 'Ні'
general_text_yes: 'Так'
general_lang_name: 'Ukrainian (Українська)'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: UTF-8
general_pdf_encoding: UTF-8
general_day_names: Понеділок,Вівторок,Середа,Четвер,П'ятниця,Субота,Неділя
diff --git a/lang/zh-tw.yml b/lang/zh-tw.yml
index 462633575..26ffa9461 100644
--- a/lang/zh-tw.yml
+++ b/lang/zh-tw.yml
@@ -48,6 +48,7 @@ general_text_no: '否'
general_text_yes: '是'
general_lang_name: 'Traditional Chinese (繁體中文)'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: Big5
general_pdf_encoding: Big5
general_day_names: 星期一,星期二,星期三,星期四,星期五,星期六,星期日
diff --git a/lang/zh.yml b/lang/zh.yml
index f412f848c..2bd0880a5 100644
--- a/lang/zh.yml
+++ b/lang/zh.yml
@@ -48,6 +48,7 @@ general_text_no: '否'
general_text_yes: '是'
general_lang_name: 'Simplified Chinese (简体中文)'
general_csv_separator: ','
+general_csv_decimal_separator: '.'
general_csv_encoding: gb2312
general_pdf_encoding: gb2312
general_day_names: 星期一,星期二,星期三,星期四,星期五,星期六,星期日