feat: i18n support for backend

This commit is contained in:
cihatata authored and cihat committed 2025-02-11 07:43:36 +03:00
1 parent 0eceac1587
commit 10713428b9
34 files changed
+1106 -838

No files matched your search

+14
View File
@@ -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('');
};