The translations provided to our users on https://shapeshift.com/ are served by a SaaS platform called WeGlot: https://www.weglot.com/
The source/native language of the Website is English, and we have the ability to translate any content served on the Website, as long as the page has an URL and that it embeds the Javascript snippet provided by Weglot:
<link rel="alternate" hreflang="en" href="[<https://shapeshift.com>](<https://shapeshift.com/>)">
<link rel="alternate" hreflang="pt-br" href="[<https://br.shapeshift.com>](<https://br.shapeshift.com/>)">
<link rel="alternate" hreflang="fr" href="[<https://fr.shapeshift.com>](<https://fr.shapeshift.com/>)">
<link rel="alternate" hreflang="es" href="[<https://es.shapeshift.com>](<https://es.shapeshift.com/>)">
<link rel="alternate" hreflang="de" href="[<https://de.shapeshift.com>](<https://de.shapeshift.com/>)">
<link rel="alternate" hreflang="zh" href="[<https://zh.shapeshift.com>](<https://zh.shapeshift.com/>)">
<script type="text/javascript" src="[<https://cdn.weglot.com/weglot.min.js>](<https://cdn.weglot.com/weglot.min.js>)"></script>
<script>
Weglot.initialize({
api_key: 'wg_fd5d844da621553e8271fafd2fd6f04e0'
});
</script>
<aside> đź’ˇ
The most updated version of this snippet can be found under “Settings > Setup” in the WeGlot admin console (for accounts with “Admin” or “Manger” permissions).
</aside>
We currently have 5 languages setup for translations:
WeGlot maintains a database of all the content of the website in the source/native language (English) and offers an UI to translators to add and review translations. Our project is currently setup to automatically translate all the content indexed by WeGlot in each language and display the translation when the user has chosen to view the page in a different languge.
Each translation entry in the WeGlot database is attached to one URL (or more than one if the exact same text exists on another page). The entries available to translate are created the first time a user visits a page and that its content isn’t already present in the WeGlot database. Each entry is generally the content of the “block” type HTML elements of the page (<h?>, <p>, <li>, etc.).
We translate the content of all the URLs except the following ones which are deliberately filtered either because we do not have the resources to translate, it would be pointless to do it, the current WeGlot plan we use would need to be upgraded to a more costly option (managed under “Settings > Translation Exclusions > Excluded URLs”):
Rule | URL to exclude | Languages | Exclusion Behavior | Reason |
---|---|---|---|---|
Matches regex | ^(?!\/(thorchain\/streaming-swaps | thorchain\/thorchain\/saver-vaults | thorchain\/lend-borrow | thorchain\/trade |
• URL redirects to Original URL | The “inverse set” of pages that we want to translate ONLY in German and Simplified Chinese. |
We do not have the budget to translate the other pages. This is why they are listed as “(Partial)” above.
The path of the translated pages from the Regex:
thorchain/streaming-swaps thorchain/saver-vaults thorchain/lend-borrow thorchain/trade thorchain/liquidity-pools trade-crypto earn-crypto metamask-multichain-snap shapeshift-defi-wallet thorchain | | Matches regex | /?newsroom/.+ | All | • Show button • URL redirects to Original URL | News articles are not translated due to lack of budget. | | Matches regex | /?library/(?!shapeshift-dao-monthly-newsletter|shapeshift-dao-governance-newsletter).+ | All | • Show button • URL redirects to Original URL | Library articles are not translated due to lack of budget, except for the “ShapeShift Monthly Newsletters”, which have now been discontinued but for which we still have translations. |
We also have a set of CSS classes that identify what WeGlot calls “blocks” that are excluded (managed under “Settings > Translation Exclusions > Excluded Blocks”):
Blocks to exclude | Description | Reason |
---|---|---|
.category-header + div.archive-section | Categories Articles Listing | Categories of library articles are not translated. |
.library-header + div.archive-section | Library Articles Listing | Library articles are not translated due to lack of budget |
.weglot-exclude | A class to apply to any content we want to avoid translating | |
.wg-element-wrapper | WeGlot internal element | |
div.blog-filter + div.div-block-324, div.blog-filter + div.div-block-324-copy | Newsletters Archives | Older newsletters |
div.home-news-collection | Homepage News Block | News articles are not translated due to lack of budget. |
div.newsroom-collection | Newsroom Articles Listing | News articles are not translated due to lack of budget. |
div.recommended-list | Related articles (in general) | News articles are not translated due to lack of budget. |
div.twitter-tweet | Twitter Tweets (inside articles/newsletters) | Tweet are not translated due to lack of budget. |
div#app div.css-1dbjc4n | Twitter Embed | Tweet are not translated due to lack of budget. |