Defect #37581

Wrong csv separator in Hungarian

Added by Attila Telek about 1 month ago. Updated about 1 month ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Translations
Target version:-
Resolution: Affected version:

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

general_csv_decimal_separator.patch Magnifier (12.1 KB) Karel Pičman, 2022-08-22 14:54

number_format_separator.patch Magnifier (4.9 KB) Karel Pičman, 2022-08-22 15:12

format_hours.patch Magnifier (1.11 KB) Karel Pičman, 2022-08-23 09:22

regional.png (143 KB) Attila Telek, 2022-08-23 15:40

example2.png (26.4 KB) Attila Telek, 2022-08-24 16:05

general_csv_separator.patch Magnifier (10.5 KB) Karel Pičman, 2022-08-25 10:13

History

#1 Updated by Go MAEDA about 1 month 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.

#2 Updated by Karel Pičman about 1 month 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.

#3 Updated by Karel Pičman about 1 month ago

Here is a patch bringing CSV decimal separators in sync with the wiki page.

#4 Updated by Karel Pičman about 1 month ago

Update of the numbers' format according to the same rules.

#5 Updated by Karel Pičman about 1 month 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

#6 Updated by Karel Pičman about 1 month ago

#7 Updated by Attila Telek about 1 month ago

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

#8 Updated by Karel Pičman about 1 month 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" 

#9 Updated by Attila Telek about 1 month ago

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.

#10 Updated by Karel Pičman about 1 month 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.

Also available in: Atom PDF