Live data from Hacker News

Reasons to Not Parse Localized Strings

blog.sffc.xyz

1–10 of 49 posts

Re: Reasons to Not Parse Localized Strings

#3
On Windows one can change how a date is rendered, without changing the locale. I need to look up if this is propagated to browsers.

Also, I hate DOB selectors which don't allow me to manually enter the date, and default to today, and don't have a year Now I need to click at least (age - 1) * 12 on the In general, I wish more websites would use native date / number / dropdown pickers.

Workday is the worst offender here.

Re: Reasons to Not Parse Localized Strings

#5

How do people who use commas as decimals disambiguate 1,004 and 1.004 without changing the precision implied by number of decimal places?

I mean, if that's how you write numbers, it's the same as disambiguating 1,004 and 1.004 if you use EN-us norms.

Which is to say, you assume it's as written, unless context suggests otherwise.

Re: Reasons to Not Parse Localized Strings

#6

How do people who use commas as decimals disambiguate 1,004 and 1.004 without changing the precision implied by number of decimal places?

You don't. It's ambiguous. Just like the string 01/03/2025 is if you don't know the source's locale.

But it can be worse. Los Angeles, Sunday, November 2, 2025, 2:00:00 am is ambiguous. Is it PST or PDT?

Re: Reasons to Not Parse Localized Strings

#7

On Windows one can change how a date is rendered, without changing the locale. I need to look up if this is propagated to browsers. Also, I hate DOB selectors which don't allow me to manually enter the date, and default to today, and don't have a year Now I need to click at least (age - 1) * 12 on the In general, I wish more websites would use native date / number / dropdown pickers. Workday is the worst offender her…

Try clicking the year number and the month name. Those often show a pop up with less clicking required to get to where you want.

Re: Reasons to Not Parse Localized Strings

#8
> Parsing Is Not a Science

It can and should be, though. I feel like we should have a separate word for parsing when the rules are not well-defined - something like "fuzzy parsing" (in a similar vein to fuzzy string comparison)

Re: Reasons to Not Parse Localized Strings

#9

On Windows one can change how a date is rendered, without changing the locale. I need to look up if this is propagated to browsers. Also, I hate DOB selectors which don't allow me to manually enter the date, and default to today, and don't have a year Now I need to click at least (age - 1) * 12 on the In general, I wish more websites would use native date / number / dropdown pickers. Workday is the worst offender her…

Is that analogous to setting LC_TIME, per application or temporary?

Re: Reasons to Not Parse Localized Strings

#10

How do people who use commas as decimals disambiguate 1,004 and 1.004 without changing the precision implied by number of decimal places?

It depends on the local norms. Where I live, 1,004 is decimal, 1 004 or 1'004 is 1004 which makes it even more clear than the en-US default. That is, the 1.004 variant is never used, and if it is, it is assumed to be a decimal (misspelling) of 1,004.
Post reply on HN