-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HI, there, i got a problem stuck me, can you help me? #126
Comments
could you show the output of |
[{"id": "", "key": "全部", "value": ""}, {"id": "60996496040d1a25940d9ea1", "color": "#d3c1d7#e8e3e6#c2b8c3", "key": "购物", "value": "5", "wordColor": "#f000ff"}, {"id": "6099641c1c9b4204ca3a552e", "color": "#ddcfba#f9f4ea_#c0b7a9", "key": "美食", "value": "1", "wordColor": "#fe8300"}] |
i want to translate the "key" in json |
Your code looks correct. What is the output and error? |
error------------------------- here it is |
@tianzige886 please provide a full reproducible code. Otherwise it's impossible to help. |
i use this package in React-Native project, and I want to translate the content returned from my Node server directly on frontend, but the content is a JSON data, like [{a: "text", b: "text2", id: 1}]. is there have a good solution to implement it? help~ help~ help~^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^_^. i've tried this way to translate the data. but it didn't work!!!
const formatTypes = async () => {
let list = [];
try {
for (const item of typeList) {
const {text} = await translate(item.key, {
to: 'en',
});
let obj = item;
obj.key = text;
list.push(obj);
}
console.log('list-------------------------');
console.log(list);
} catch (e) {
console.log('error-------------------------');
console.log(e);
}
};
The text was updated successfully, but these errors were encountered: