Custom text and multi-language settings
Slide-to-verify supports 18 languages by default. You can select a language by modifying the `language` initialization parameter.
The default value for the `language` parameter is `cn`, which stands for Simplified Chinese.
cn: Simplified Chinese
tw: Traditional Chinese
en: English
ar_SA: Arabic
de_DE: German
es_ES: Spanish
fr_FR: French
in_ID: Indonesian
it_IT: Italian
iw_HE: Hebrew
ja_JP: Japanese
ko_KR: Korean
nl_NL: Dutch
pt_BR: Portuguese
ru_RU: Russian
th_TH: Thai
tr_TR: Turkish
vi_VN: Vietnamese
You can use the upLang initialization parameter to customize the text of the slide-to-verify component. The component includes built-in text for Simplified Chinese, Traditional Chinese, and English. You can customize the text for these languages or add a new language by passing a new language value.
/**
* Language name. Options include cn, tw, and en. You can also add a custom language.
* Language details in key-value format.
*/
var myLang = {
'cn': {
// Loading status prompt.
'LOADING': "Loading...",
// Prompt for the waiting-to-slide state.
'SLIDE': "Slide right to verify",
// Prompt for the verification passed state.
'SUCCESS': "Verified",
// Prompt for the verification failed and blocked state.
'ERROR': "Sorry, a network error occurred...",
// Prompt for the verification failed and blocked state.
'FAIL': "Verification failed. Please try again."
}
}
AWSC.use("nc",function(state,module){
window.nc = module.init({
...
upLang: myLang
...
})
})