"Sign In with Apple" JS button localization

Currently, the button provided by apple.auth.js only displays text in English.


However, Apple provides an article that explains how to download localized PNG versions to be used if you want to implement the feature in other platforms.


Anyone knows if there is a way to make the JS display a localized button, maybe passing a data-locale or data-lang attribute to the apple-signin div?

Replies

So a list of locale options can be found here: https://developer.apple.com/documentation/signinwithapplejs/incorporating_sign_in_with_apple_into_other_platforms


And you just adjust your JS import to match. So by default it's https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js but you can adjust that URL based on the locale and it will adjust the button text.

For example: https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/fr_FR/appleid.auth.js