Defect #37581
openWrong csv separator in Hungarian
Added by Attila Telek over 2 years ago. Updated over 2 years ago.
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
general_csv_decimal_separator.patch (12.1 KB) general_csv_decimal_separator.patch | Karel Pičman, 2022-08-22 14:54 | ||
number_format_separator.patch (4.9 KB) number_format_separator.patch | Karel Pičman, 2022-08-22 15:12 | ||
format_hours.patch (1.11 KB) format_hours.patch | Karel Pičman, 2022-08-23 09:22 | ||
regional.png (143 KB) regional.png | Attila Telek, 2022-08-23 15:40 | ||
example2.png (26.4 KB) example2.png | Attila Telek, 2022-08-24 16:05 | ||
general_csv_separator.patch (10.5 KB) general_csv_separator.patch | Karel Pičman, 2022-08-25 10:13 |
Updated by Go MAEDA over 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 over 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 over 2 years ago
Here is a patch bringing CSV decimal separators in sync with the wiki page.
Updated by Karel Pičman over 2 years ago
Update of the numbers' format according to the same rules.
Updated by Karel Pičman over 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 over 2 years ago
- File format_hours.patch format_hours.patch added
Updated by Attila Telek over 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 over 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 over 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 over 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.