shapeshift / lib

MIT License
22 stars 54 forks source link

Asset descriptions should be matching user locale #836

Closed gomesalexandre closed 2 years ago

gomesalexandre commented 2 years ago

@shapeshift/operations Reserved for @sebfk

Overview

Currently in lib, we are using the asset descriptions from Coingecko API and getting only the en description from it. Similarly, our overriden descriptions are only in English.

We should make it so that descriptions are dynamic according to the user language.

Since we are calling asset-service's description, lib would be the best place to handle it and we could make this method accept a locale parameter to pick the right translation from Coingecko, or fallback to English if it isn't available for that language (empty string). See the Ethereum Coingecko API call.

For the overriden description, there are two ways to implement this:

A web PR should also be made to bump the @shapeshiftoss/asset-service dependency and consume the updated description(assetId, locale) signature.

References and additional details

asset-service's description descriptions.json for the overriden descriptions Polyglot.js (node-polyglot in npm) web translations logic

Acceptance Criteria

Need By Date

No response

Screenshots/Mockups

No response

Estimated effort

3 hours

Lychbot commented 2 years ago

Done listing in Dework here . Assigned to @sebfk and put you as a reviewer @gomesalexandre :)

gomesalexandre commented 2 years ago

Fixed by https://github.com/shapeshift/web/pull/2098