apuyou / store-badge

Display App Store and/or Google Play badges on your website based on the browser
https://apuyou.github.io/store-badge/
MIT License
15 stars 2 forks source link

Localized Badges? #39

Open chrisvire opened 4 months ago

chrisvire commented 4 months ago

How would I get a localized badge? I would like to display the localized version of the badge based on the language of the browser.

hatton commented 1 month ago

@chrisvire I have the same need. Did you come up with a solution?

chrisvire commented 1 month ago

@hatton Here is our implementation of App Store and Google Play localized badges in the SvelteKit implementation of our PWA:

https://github.com/sillsdev/appbuilder-pwa/blob/main/src/routes/share/%2Bpage.svelte

For the Google Play Badges, we linked to the images based on the language name. For the App Store Badges, we copy the badges into the PWA based on what localizations are used by the PWA.

https://github.com/sillsdev/appbuilder-pwa/blob/main/convert/convertBadges.ts https://github.com/sillsdev/appbuilder-pwa/tree/main/convert/badges