Translations

Overview of all customization options for the wording in the Connector purchase overlay

You can provide your own translations for all translatable strings in the user interface elements rendered by Connector Script.

Translatable strings are identified by translation keys of the format $component:$element.

Example 1:

<meta property="laterpay:connector:translations:purchase_button:label_with_price" content="Read article now for only %s">

This replaces the default translation for purchase_button:label_with_price with the string “Read article now for only %s”. The sequence %s is replaced by the current price and currency when the Purchase Overlay is rendered.

Example 2:

<meta property="laterpay:connector:translations:purchase_overlay:notes_text" content="&lt;a href=&quot;http://yourlink.com/signin&quot;&gt;Sign in&lt;/a&gt; if you are an existing customer">

This sets the optional purchase_overlay:notes_text.

Note

HTML entities need to be encoded in translations strings, because they are passed through HTML attributes.

Translatable Elements With Defaults

These are the defaults of the currently available translatable elements for the locale English (US) which have defaults:

{
  "purchase_overlay": {
    "heading": "Read now, pay later",
    "powered_by": "Powered by",
    "current_article": "This article",
    "open_quotes": "“",
    "close_quotes": "”"
  },
  "dialog_overlay": {
    "close_btn_title": "Close dialog"
  },
  "purchase_button": {
    "title": "Buy now with LaterPay"
  },
  "purchase_button_ppu": {
    "label": "Buy now, pay later",
    "label_with_price": "Buy now, pay later: %s"
  },
  "purchase_button_sis": {
    "label": "Buy now",
    "label_with_price": "Buy now for %s"
  },
  "purchase_button_ppu_subs": {
    "label": "Subscribe now, pay later",
    "label_with_price": "Subscribe now, pay later: %s"
  },
  "purchase_button_sis_subs": {
    "label": "Subscribe now",
    "label_with_price": "Subscribe now for %s"
  },
  "identify_button": {
    "label": "I already bought this",
    "title": "If you have already bought this item, please click here to restore your purchase."
  },
  "help_button": {
    "label": "Disable Adblocker",
    "title": "Click here to find out how to disable your adblocker for this site"
  },
  "advantage": {
    "heading": "This website is financed by ads.<br>The content is not accessible for free with an active adblocker.",
    "allow_ads_heading": "Allow ads on this website",
    "allow_ads_description": "This dialog will disappear after you have disabled your Adblocker and reload the page.",
    "adblocker_deactivation_label": "Reload Page",
    "adblocker_deactivation_description": "",
    "splitbar_label": "OR",
    "no_ads_heading": "Access ad-free with your adblocker",
    "powered_by": "Powered by"
  },
  "test_mode_notice": {
    "heading": "Site in Test Mode",
    "description": "– No payment required –"
  }
}

Here are some things to consider:

  • The label_with_price translations are used, when there is only one item in the purchase list.
  • These translations are interpolated so that they can contain a price string, which is represented by a %s sequence in the translation string. This feature can be used in your custom translations, too.
  • Translations contained in the component purchase_button_ppu are used, when the currently selected item in the purchase list is configured as “Pay per use”.
  • Translations contained in the component purchase_button_sis are used, when the currently selected item in the purchase list is configured as “Single item sale”.

Optional Translatable Elements

The following translatable elements are optional and don’t have defaults. They are hidden, unless you define translations for them:

{
  "purchase_overlay": {
    "body_text": null,
    "notes_text": null,
    "footer_text": null
  }
}

Sanitizing

To protect your website against XSS attacks, all translation strings are sanitized using DOMPurify. However, some tags and attributes are white listed so that you can :

Allowed HTML tags in translation strings

[ "a", "img", "strong", "em", "b", "i", "ul", "ol", "li", "br" ]

Allowed HTML attributes in translation strings

[ "href", "class", "src" ]