Skip to content

The responses CSV uses commas, which Excel in Sweden doesn't split into columns #985

Done

Description

@richshaw

Needs your OK: this changes the downloaded responses file for organizers whose language writes decimals with a comma (Swedish, today): its columns would be split by semicolons, and its file name would be in their language. Swap pipeline:proposed for pipeline:ready to have it built.

What happens

  • responsesCsv in src/lib/responses-csv.ts always joins cells with a comma.
  • Excel doesn't read the separator from the file. It takes it from the computer's regional settings, and where the decimal mark is a comma (Sweden, and most of Europe) the list separator is ;.
  • So on such a computer, double-clicking the file shows each row squeezed into column A, and the organizer has to use Data → Text to Columns to get a table.
  • The localization stack (Epic: OpenSignup in Swedish, and other languages after it #619) gives the file Swedish column names (Responses and the CSV's column names are English-only #945). The organizers who download it in Swedish are exactly the ones whose Excel won't split it.
  • The file name is English for everyone: <slug>-responses.csv, set in src/app/api/signups/[id]/export.csv/route.ts.

Not opened in a real Excel. This is how Excel treats a CSV, worked out from its rules, not from a run.

Fix, in outline

  • The separator follows the organizer's language. The route already reads it (getOrganizerAppLocale). Use ; when that language writes decimals with a comma, and , otherwise. Work it out with Intl.NumberFormat(locale).formatToParts(1.5) (the decimal part). That is the same rule Excel follows, so a new language needs no table.
  • responsesCsv takes the separator as an option, and csvEscape quotes any cell that holds the separator in use. Today it only quotes cells with ,, " or a line break.
  • The file name comes from the catalog: organizer.responses.csv.fileName with a {slug} placeholder. English stays {slug}-responses.csv.

Watch for

  • No sep=; first line. Excel honours it, but then ignores the UTF-8 BOM and garbles å, ä and ö. Google Sheets and Numbers show it as a data row.
  • The BOM stays, for the same reason it's there now.
  • English output stays byte for byte the same. src/lib/responses-csv.test.ts and export.csv/route.db.test.ts pin it.
  • A file name with å, ä or ö needs filename*=UTF-8''… in Content-Disposition, next to a plain ASCII filename= for old clients.
  • Numbers are written as stored (1.5), which a comma-decimal Excel reads as text. The docblock explains why values stay raw. Keep it that way, and add a line saying the separator is the only thing that follows the language.
  • Help pages that call the file "comma-separated", if any.

Choices this makes

  • The organizer's language, not their browser's region. An English-speaking organizer in Sweden would still get commas. The alternative, the region in the download request's Accept-Language, is right more often, but it makes one link give different files on different computers. Default: the organizer's language.
  • The Swedish file name. Default: {slug}-anmälningar.csv.

Order

After #945, because the route only learns the organizer's language there.

Done when

  • For an organizer whose language is Swedish, the file uses ;, quotes cells that contain ;, keeps the BOM, and is named <slug>-anmälningar.csv.
  • For English, the file is byte for byte what it is today.
  • A unit test with a Swedish translator pins both separators and the quoting.
  • pnpm lint && pnpm typecheck && pnpm knip && pnpm test and pnpm test:db pass.

Found by the UX walkthrough, scenario L4 (a Swedish organizer gets the list into a spreadsheet). Run on the localization stack merged locally (#982 + #980 + #931, at 33c8c0d) with Swedish switched on locally, and checked against responses-csv.ts and the export route there. main at 2f58ce82 also joins with commas.


Generated by Claude Code

Activity

  1. added
    enhancement
    pipeline:ux
    pipeline:working
    and removed on Nov 15, 2026
  2. self-assigned this
    on Nov 23, 2026
  3. removed
    pipeline:working
    on Nov 23, 2026
  4. removed
    pipeline:ux
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions