我正在使用 ARB google's API 进行本地化但实际上占位符不起作用,我花了 5 个小时来解决这个问题,但没有成功
arb.register(
"login",
{
"title": "Login",
"subtitle": "to your account",
"MSG_BODY_TEST": "This is a test.",
"email": "Email {0}",
"@email": {
"placeholders": {
"0": {
"example": "$123.45",
"description": "cost presented with currency symbol"
}
}
},
"MSG_CURR_LOCALE": "...and the selected language is \"{currentLocale}\"."
}
);
arb.register(
"login:ar",
{
"title": "الدخول",
"subtitle": "الى حسابك",
"email": "البريد الاكتروني {0}",
"@email": {
"placeholders": {
"0": {
"example": "$123.45",
"description": "cost presented with currency symbol"
}
}
},
"MSG_CURR_LOCALE": "...and the selected language is \" {currentLocale}\"."
}
);
有人可以告诉我问题是什么吗?
好吧,尝试将 "email": "Email {0}"
替换为 "email@placeholder": "Email"
检查这个:reference
同时删除不需要的占位支架
我是一名优秀的程序员,十分优秀!