netrunner
netrunner copied to clipboard
Add NSG card images in translated languages
Card images for translated languages is already supported. However, I believe none of them are currently available.
https://github.com/mtgred/netrunner/issues/5493 says Chinese cards were added to the site but checking the cards with each ofthe Chinese languages didn't show any cards. I believe https://github.com/mtgred/netrunner/commit/1eeeddddb8cb7f90ec3492edb87a4320fc76b501 changed the image format from <num>[<lang]
to a path-based one and may have caused the images to become unavailable again.
Two requests:
- Ensure any existing card image data follows the current format to make it available on the site.
- Add card images for recent sets. I'm specifically interested in the Japanese cards and if work is required to get data from NSG into a suitable naming/organization factor, I'm happy to take that on.
I have the Japanese card images, so that takes care of (2). Need to figure out how to do (1) now.
https://github.com/mtgred/netrunner/pull/6954 addresses #1 https://github.com/NetrunnerDB/netrunnerdb/issues/746 addresses #2
Recently I noticed that Chinese language card images no longer show up in the card browser unless I access the site from a device that already knows that those images exist. Otherwise I had to open the card image in a new tab and manually change the "en" in the URL to "zh-simp" to see those cards. Does this have something to do with these recent changes?
Interesting -- I didn't realize the zh-simp card images were still hosted on jnet. The problem comes from the jnet fetch process needing to know those images exist to insert them into the database (and then display them to the user if available). The existence of the card images on the jnet server alone isn't sufficient to display them anymore.
Making Japanese card images available is still WIP via https://github.com/NetrunnerDB/netrunnerdb/issues/746 but we should be able to extend it to zh-simp (and whatever else is available) as well. Getting the images hosted on netrunnerdb will give us a robust solution for card image availability without losing them again.
Bumping this @NoahTheDuke @NBKelly I'm interested in adding 2 NSG sets available in Russian to jnet. If this is possible, I can invest time into clearing this with NSG if necessary, and uploading/naming the images etc if someone shows me how it's done.
Hi, I investigated this a little.
Images are stored under: resources/public/img/cards/[lang]/default/stock/
(lang being ru in this case, and en normally).
Ideally, when we run lein fetch
it would pick up the alternate language files from netrunnerdb, but I don't think they've had any traction on doing that feature yet. In any case, if we manually add them, they wont get overwritten unless something goes majorly wrong.
I think after you run lein fetch
, any images you places in that folder should become visible.
The naming convention is just card-id.[png|jpg]
(ideally png), where card-id
is the id on netrunnerdb - which should be the same as the ones on jinteki.net in every case (I hope).
For example, laamb is 21086
: https://netrunnerdb.com/en/card/21086
So if I added the file resources/public/img/cards/ru/default/stock/21086.png
, that would get picked up as the ru version of laamb.
Once you've got something you're happy with, we can save a copy somewhere for later and add it on the public server.