Skip to content

Instantly share code, notes, and snippets.

@vulieumang
Created August 20, 2021 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vulieumang/fb1c60d44790a01550f3419365f2b1f1 to your computer and use it in GitHub Desktop.
Save vulieumang/fb1c60d44790a01550f3419365f2b1f1 to your computer and use it in GitHub Desktop.
Translate wpDiscuz from label
// using chrome and press translate and using this script in console
// sử dụng chrome để dịch trang, sau đó dùng script ở console, script sẽ copy label to input
let products = [];
let product_wrapper = document.querySelectorAll('.wp-list-table tr');
product_wrapper.forEach((product) => {
let dataJson = {};
try {
dataJson.title = product.querySelector('label font font').innerText;
product.querySelector('input').value = dataJson.title;
product.querySelector('textarea').value = dataJson.title;
}
catch (err) {
console.log(err)
}
products.push(dataJson);
});
console.log(products);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment