icflorescu / mantine-datatable

The table component for your Mantine data-rich applications, supporting asynchronous data loading, column sorting, custom cell data rendering, context menus, nesting, Gmail-style batch row selection, dark theme, and more.
https://icflorescu.github.io/mantine-datatable/
MIT License
949 stars 68 forks source link

Added support for unicode Latin-1 Supplement in humanize() #592

Closed NumiLarsson closed 5 months ago

NumiLarsson commented 6 months ago

Updated the regex in humanize to support some commonly used "foreign" characters, Latin-1-Supplement is sorted nicely with upper / lower case characters, so only did the basics that covers my use case, but it's possible to extend this support much longer.

See: https://symbl.cc/en/unicode-table/#latin-1-supplement

I added the characters: 00C0-00D6, 00D8-00DD (uppers) 00E0-00F6, 00F8-00FD (lowers)

codesandbox[bot] commented 6 months ago

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

icflorescu commented 5 months ago

I'm a bit reluctant to this, as it would over-complicate that regex in order to cover an edge case which is - frankly - a bit of an anti-pattern. You shouldn't have property names containing "foreign" characters. Proper code identifiers (i.e. variables, properties, function names) should always be written in English. I perfectly understand your intention as my native language is Romanian and we use a lot of "foreign" characters. Moreover, I am actually very particular about using them to write prose correctly, but never in code.