You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
原因:setLocale的方法里面有这个校验
if (lang !== undefined && !/^([a-z]{2})-([A-Z]{2})$/.test(lang)) {
// for reset when lang === undefined
throw new Error('setLocale lang format error');
}
复现:钉钉浏览器的汉语是:zh-Hans-CN,当用户在钉钉浏览器切换中文时需setLocale("zh-Hans-CN"),那么就会抛错误 throw new Error('setLocale lang format error');
The text was updated successfully, but these errors were encountered:
问题:umi/locale的setLocale(lang),只支持zh-CN这中形式,能不能支持zh-cn。只能本地手动做映射?有没有好的方案兼容性lang这个参数不一定是/^([a-z]{2})-([A-Z]{2})$/.test(lang),有可能是/^([a-z]{2})-([a-z]{2})$/.test(lang)。
原因:setLocale的方法里面有这个校验
if (lang !== undefined && !/^([a-z]{2})-([A-Z]{2})$/.test(lang)) {
// for reset when lang === undefined
throw new Error('setLocale lang format error');
}
复现:钉钉浏览器的汉语是:zh-Hans-CN,当用户在钉钉浏览器切换中文时需setLocale("zh-Hans-CN"),那么就会抛错误 throw new Error('setLocale lang format error');
The text was updated successfully, but these errors were encountered: