jjallaire / draftpod

Draft simulator for Magic the Gathering
https://draftpod.org
MIT License
36 stars 7 forks source link

Feature Request: Multilingual Card Image Support #87

Open kokuyouwind opened 1 year ago

kokuyouwind commented 1 year ago

Abstruct

I would like to play drafts with friends in Japanese. scryfall.com supports multilingual card images. Is it possible for Draftpod to also support multilingual card image display? If only the card images can be replaced with the respective language versions, I think it would be enough to realize a draft experience in each language even if the entire UI remains in English.

Idea

Persistence of card information

We can get a list of cards in a specific language by using URLs like https://api.scryfall.com/cards/search?q=set:one+lang:ja&include_multilingual=true. Adding the URL of each card image directly to public/sets/[set_code]/cards.json will increase the data of unused languages, so I suggest adding a file like public/sets/[set_code]/[lang_code]/cards.json to holding the card data for each language. In this case, it would be better to serialize the data in the form of an object whose key is collector_number so that it is easy to retrieve the data of each language version from the English version of the cards.

We will need to add a function to tools/download_set.R to specify the language of acquisition, or add a new script file similar to this one.

Specify language

I think it would be straightforward to add a card language specification pull-down in the footer of the overall layout, and persist the selection state in store.js.

Get image URIs.

If a language other than English is specified, the image URI for that language should be obtained in cardImageUris in store/modules/draft/selectors.js. If the image URL for that language version does not exist, we can fall back to the English image URI to preserve the existing behavior.

Translated with www.DeepL.com/Translator (free version)