Defect #37581
openWrong csv separator in Hungarian
0%
Description
Hungarian csv separator is semi-colon and decimal separator is comma.
Latest locale config contains wrong settings for this.
root / trunk / config / locales / hu.yml @ 13552
general_csv_separator: ',' -> ';'
general_csv_decimal_sperator: '.' -> ','
Can you please fix this?
thank you
Files
Updated by Go MAEDA about 2 years ago
Can you please provide documentation showing that the current values of general_csv_separator and general_csv_decimal_sperator in Hungarian are incorrect?
For example, a CSV file output by the Hungarian version of the spreadsheet software, or web pages or screenshots that contains decimal values.
Updated by Karel Pičman almost 2 years ago
I think that Attila is right concerning the decimal separator. The most of European countries use comma. Please see https://en.wikipedia.org/wiki/Decimal_separator#Usage_worldwide for reference.
Concerning the csv separator I wouldn't agree. As the name suggests it should be always comma - Comma Separated Values.
Updated by Karel Pičman almost 2 years ago
Here is a patch bringing CSV decimal separators in sync with the wiki page.
Updated by Karel Pičman almost 2 years ago
Update of the numbers' format according to the same rules.
Updated by Karel Pičman almost 2 years ago
Concerning the number format separator, I have realized after I had changed it to comma, that it is not taken into account in displaying spent and planned hours on tasks. If I set it to comma, the time is still presented with dot. I think that the function Redmine::I18n.format_hours(hours) should be changed as follows:
def format_hours(hours) return "" if hours.blank? if Setting.timespan_format == 'minutes' h = hours.floor m = ((hours - h) * 60).round "%d:%02d" % [h, m] else -- "%.2f" % hours.to_f ++ sprintf("%.2f", hours.to_f).gsub('.', l(:"number.format.separator")) end end
Updated by Karel Pičman almost 2 years ago
- File format_hours.patch format_hours.patch added
Updated by Attila Telek almost 2 years ago
- File regional.png regional.png added
Karel Pičman wrote:
I think that Attila is right concerning the decimal separator. The most of European countries use comma. Please see https://en.wikipedia.org/wiki/Decimal_separator#Usage_worldwide for reference.
Concerning the csv separator I wouldn't agree. As the name suggests it should be always comma - Comma Separated Values.
Maybe the csv extension has been founded before the regional settings or they didnt find a better name ('Something Separated Values' wouldn't be very professional)
With a hungarian region, comma separator couldn't be used because it is the decimal separator.
By the way I found that the separator character comes from windows regional settings:
more: https://www.koskila.net/how-to-change-the-delimiter-when-exporting-csv-from-excel/
It is deeply integrated to all office applications.
Here is an example csv content saved from my excel:
1st col: half;2nd column: Pi 0,5;3,1415
Updated by Karel Pičman almost 2 years ago
With a Hungarian region, comma separator couldn't be used because it is the decimal separator.
If you try to export issues with time entries into CVS in Redmine, you will see that it could:
values,"0,5","3,1415"
Updated by Attila Telek almost 2 years ago
- File example2.png example2.png added
Karel Pičman wrote:
With a Hungarian region, comma separator couldn't be used because it is the decimal separator.
If you try to export issues with time entries into CVS in Redmine, you will see that it could:
[...]
This could have been a good solution but Microsoft decided to use Windows Regional Settings as the column separator in csv files.
Excel uses semicolon in Hungary (and in 80 additional countries) and cannot interpret comma separated CSV files.
I have no info about other spreadsheet softwares but your example export cannot be loaded directly into excel:
Maybe Microsoft mis-interpreted the standard but they are the market leaders so redmine might be adapted to this solution.
Updated by Karel Pičman almost 2 years ago
So, in order to support Microsoft Office, we should use semicolon as CVS separator, if the decimal separator is comma. Here is a patch.