There’s no need to keep track of anything on your site. You should be able to implement it stateless.
-
For polling, you need to send a
GETrequest to the following path on your site:
/admin/customize/site_texts.json?locale=en&overridden=true&page=0Adjust the
localeparameter to your needs. The API returns up to 50 results and supports pagination (pageparameter).
The JSON will include{ "extras" : { "has_more" : true } }when there are more results. -
Updating a translation override works by sending a
PUTrequest to the following path:
/admin/customize/site_texts/<id>Replace
<id>with the ID of the string you want to translate, e.g. “js.user.username.instructions”.The payload of the
PUTrequest must be form data (Content-Type:application/x-www-form-urlencoded; charset=UTF-8) and must include the following attributes:site_text[value]: the translationsite_text[locale]: the locale, e.g. “en”
Essentially you need to use the same API calls that the Customize Text admin interface uses.