Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: number localization #85

Open
IvanSanchez opened this issue Mar 7, 2021 · 1 comment
Open

Feature request: number localization #85

IvanSanchez opened this issue Mar 7, 2021 · 1 comment
Labels

Comments

@IvanSanchez
Copy link

IvanSanchez commented Mar 7, 2021

This is a follow-up of #70/#78, re: numbers of credits in trade goods tables.

I use the ES-es locale, which means that "ten thousand" is written as 10.000 with a dot as the thousands separator. I find it slightly irritating to see numbers pre-formatted in the EN-us locale, such as as 10,000.

I'm specifically thinking of leveraging https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString - then wrap each number in a <span> CSS class and perform a bit of magic with document.querySelectorAll. Maybe throw in some data attributes to keep track of units of measurement per <span>.

Bonus super fancy request: see if there's a way to leverage currency formatting (since some locales put the currency symbol as a prefix instead of as a suffix) while using imperial credits/kilocredits (Cr/kCr) as the currency symbol.

This might arguably need a whole new "settings" section on the site, to let users override the browser's default locale and set a cookie to do so.

@Grauenwolf
Copy link
Owner

We're going to need the concept of "user settings", probably stored in a cookie because we don't have a database.

Also need to research user local/culture settings in Blazor. Unfortunately the JavaScript library isn't going to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants