Greasy Fork is available in English.

Taobao to USD

Convert CNY to USD in Taobao listing

// ==UserScript==
// @name         Taobao to USD
// @namespace    http://tampermonkey.net/
// @version      1.0.3
// @description  Convert CNY to USD in Taobao listing
// @author       stickylfs
// @include      https://s.taobao.com/*
// @require      https://code.jquery.com/jquery-3.5.1.min.js
// @run-at      document-end
// ==/UserScript==
function convertPrices() {
  $(".g_price-highlight strong").each(function () {
    if ($(this).parent().hasClass("converted")) return;
    let convertedPrice = Math.round(Math.ceil($(this).html()) * 0.15);
    $(this).html($(this).html() + " ~$" + convertedPrice);
    $(this).parent().addClass("converted");
  });
}
function translateAll() {
  document.title = "Taobao";

  $("a[trace='imgsearch_gender']:contains('全部')").html("All");
  $("a[trace='imgsearch_gender']:contains('女')").html("Men");
  $("a[trace='imgsearch_gender']:contains('男')").html("Women");
  $("a[trace='imgsearch_gender']:contains('童')").html("Kid");
  $("h4.collection-title:contains('外观相似宝贝')").html("Similar images");
  $("a.img-crop-btn:contains('框选主体')").html(
    "<span class='icon-btn-crop'></span>Crop"
  );
  $("div.location:contains('北京')").html("Beijing");
  $("div.location:contains('广东 深圳')").html("Shenzhen");
  $("div.location:contains('广东 深圳')").html("Guangzhou");
  $("div.location:contains('广东 东莞')").html("Guangzhou");
  $("div.location:contains('广东 广州')").html("Guangzhou");
  $("div.location:contains('黑龙江 齐齐哈尔')").html("Heilongjiang");
  $("div.location:contains('浙江 杭州')").html("Zhejiang");
  $("span.text:contains('包邮')").html("Free shipping");
  $("span.text:contains('赠送退货运费险')").html("Free return insurance");
  $("span.text:contains('货到付款')").html("Cash on delivery");
  $("span.text:contains('新品')").html("New product");
  $("span.text:contains('二手')").html("Used product");
  $("p#J_pailitaoMessageTitle:contains('上传失败')").html("Upload failed");
  $("div.pailitao-message-content p.msg:contains('请重新上传试试')").html(
    "Please try again"
  );
  $("p#J_pailitaoMessageTitle:contains('正在努力上传中')").html("Uploading...");
  $("p#J_pailitaoMessageTitle:contains('图片上传成功')").html(
    "Upload successful!"
  );
  $("div.pailitao-message-content p.msg:contains('正在努力跳转')").html(
    "Redirecting..."
  );
  $("a[trace='imgsearch_cat']:contains('上衣')").html("Coat");
  $("a[trace='imgsearch_cat']:contains('裙装')").html("Skirt");
  $("a[trace='imgsearch_cat']:contains('箱包')").html("Bag");
  $("a[trace='imgsearch_cat']:contains('鞋')").html("Shoes");
  $("a[trace='imgsearch_cat']:contains('配饰')").html("Accesories");
  $("a[trace='imgsearch_cat']:contains('零食')").html("Food");
  $("a[trace='imgsearch_cat']:contains('美妆')").html("Beauty");
  $("a[trace='imgsearch_cat']:contains('瓶饮')").html("Drink");
  $("a[trace='imgsearch_cat']:contains('玩具')").html("Toys");
  $("a[trace='imgsearch_cat']:contains('内衣')").html("Underwear");
  $("a[trace='imgsearch_cat']:contains('数码')").html("Digital");
  $("a[trace='imgsearch_cat']:contains('服饰')").html("Wear");
  $("a[trace='imgsearch_cat']:contains('其他')").html("Other");
  $("span.site-nav-region:contains('全球')").html("Region");
  $("div.site-nav-menu-hd a span:contains('手机逛淘宝')").html(
    "Download TaoBao App"
  );
  $("button.icon-btn-search:contains('搜索')").attr(
    "style",
    "background: #ff3f00; color: white; font-size: 16px;"
  );
  $("button.icon-btn-search:contains('搜索')").html("Search");
  $("ul.triggers li:contains('宝贝')").html("Item");
  $("ul.triggers li:contains('店铺')").html("Shop");
  $("div.footer").length && $("div.footer").remove();
  $("a.img-croper-ok:contains('确定')").html("Crop");
  $("a.img-croper-canel:contains('取消')").html("Cancel");
  $("div.markets div.label span:contains('更多市场')").html("Markets");
  $("span.tmsg_logo_text:contains('消息')").html("Messages");
  $("div.menu-hd a[href='//www.taobao.com/m']:contains('手机逛淘宝')").html(
    "TaoBao Mobile"
  );
  $("div.menu-hd a[href='//www.taobao.com/']:contains('淘宝网首页')").html(
    "Home"
  );
  $("a[href='//i.taobao.com/my_taobao.htm']:contains('我的淘宝')").html(
    "My Taobao"
  );
  $("li#J_MiniCart div.menu-hd a span:contains('购物车')").html("Cart");
  $("div.menu-hd a span:contains('收藏夹')").html("Wish list");
  $(
    "div.site-nav-menu-hd a[href='//www.taobao.com/'] span:contains('淘宝网首页')"
  ).html("Home");
  $("div.site-nav-menu-hd a span:contains('购物车')").html("Cart");
  $("div.site-nav-menu-hd a span:contains('收藏夹')").html("Wish list");
  $(
    "a[href='//www.taobao.com/markets/tbhome/market-list']:contains('商品分类')"
  ).html("Categories");
  $(
    "div.menu-hd a[href='//mai.taobao.com/seller_admin.htm']:contains('卖家中心')"
  ).html("Seller panel");
  $(
    "div.menu-hd a[href='//service.taobao.com/support/main/service_center.htm']"
  ).html("Service center");
  $(
    "div.menu-hd a[href='//www.taobao.com/sitemap.php?id=sitemap2'] span:contains('网站导航')"
  ).html("Site map");
  $(
    "div.site-nav-menu-hd a[href='//world.taobao.com/helper/']:contains('海外消费者帮助')"
  ).html("Help");
  
  $("div#J_LoginInfoHd a:contains('亲,请登录')").html("Login");
  $("div#J_LoginInfoHd a:contains('免费注册')").html("Register");
  
  $("div.site-nav-menu-hd div.site-nav-sign a:contains('亲,请登录')").html("Login");
  $("div.site-nav-menu-hd div.site-nav-sign a:contains('免费注册')").html("Register");

  // enable image search
  $("style:contains('search-imgsearch-panel')").remove();
}

window.setInterval(function () {
  convertPrices();
  translateAll();
}, 1000);