ITADN

feat: use locale version of built-in uppercase and lowercase utils

#1616Opendanielwaltz 创建于 2026-02-12
D
danielwaltzcommented
In utilities like `capitalize`, the built-in utils used to change case (`toUpperCase` and `toLowerCase`) do not respect the user's locale. For instance: ```ts "turkish".toUpperCase() // outputs 'TURKISH' "turkish".toLocaleUpperCase("tr") // outputs 'TURKİSH' ``` This is a rare edge case and varies based on language. Passing the locale string could perhaps be supported as an additional argument, however by default the user's locale will be used. It could be debated as well if using the locale version of these built-ins even makes sense as the default. They are at least baseline widely available. I have just adopted them in my projects and was a little surprised to see it unused here. Thanks!
0 条评论