vue-translation-manager
vue-translation-manager copied to clipboard
An error if the text contains
In the console the error looked like this
To fix this, I edited this function, which originally looked like this:
/**
* camelCase any string
* @param {string} text The string to be camelCased
* @returns {string} theStringInCamelCase
*/
function camelCase (text) {
return text
.trim()
.split(' ')
.map((word) => word.toLowerCase())
.map((word, i) => (i === 0 ? word : word[0].toUpperCase() + word.substring(1)))
.join('')
}
After my editing, she got this look:
/**
* camelCase any string
* @param {string} text The string to be camelCased
* @returns {string} theStringInCamelCase
*/
function camelCase (text) {
return text
.trim()
.split(' ')
.map((word) => word.toLowerCase())
.map((word, i) => (i === 0 && !word[0] ? word : String(word[0]).toUpperCase() + word.substring(1)))
.join('')
}
And the translation worked successfully. :tada::tada::tada: