feat: i18n support for backend
This commit is contained in:
1 parent
0eceac1587
commit
10713428b9
34 files changed
+1106
-838
No files matched your search
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Converts a snake_case or SCREAMING_SNAKE_CASE key to camelCase
|
||||
* Example: AUTH_INCORRECT_PASSWORD -> authIncorrectPassword
|
||||
* @param {string} key - The key to format
|
||||
* @returns {string} - The formatted key in camelCase
|
||||
*/
|
||||
export const formattedKey = (key) => {
|
||||
return key.toLowerCase()
|
||||
.split('_')
|
||||
.map((word, index) =>
|
||||
index === 0 ? word : word.charAt(0).toUpperCase() + word.slice(1)
|
||||
)
|
||||
.join('');
|
||||
};
|
||||
Reference in new issue
Block a user