The langify core provides several of langify's key functionalities like the language- and currency switcher codes, such as various helper functions and a module that can handle the translations on dom elements even if their content is applied asynchronously.


You will find the core in the /snippets/ly-core-scripts.liquid file in your theme. Each time you log into or select a theme in langify the ly-core-scripts.liquid file will be overwritten, with the newest core version. Therefore you should not make any changes inside this file directly!!!



Overwrite Core Settings

Langify provides a settings object which allows you to control the behavior of the core. You just would have to paste the langify.settings object in the theme.liquid file near the closing </body> tag right before the ly-core-scripts gets renderd.



You can use the following snippet (don't forget to remove or replace the ... with settings from the core-settings object):

<script>
  var langify = langify || {};
  langify.settings = {
      debug: true,
      ...
  }
</script>



Core Settings Object


NameTypeDefaultDescription
debugboolfalse
Enable/disable console logs
observebool
true
Enable/disable the entire mutation observer (off switch)
observeLinks
bool
true
Enable/disable the observation and translation of links in the document
observeImages
bool
true
Enable/disable the observation and translation of images in the document
observeCustomContents
bool
true
Enable/disable the observation and translation of Custom Contents in the document
timeoutint100
Milliseconds to wait after a mutation, before the next mutation event will be allowed for the element
linksBlacklistarray[]
A comma-separated list of URLs that should not be "localized" by the translation observer



Data Attributes


Name
Description
data-ly-locked<a data-ly-locked="true" href="...">Link</a>
All HTML elements with this attribute will be ignored from the translation observation.

IMPORTANT: This would have no effect when applied on a liquid form tag.



URL Parameter


Name
Description
ly-lang-detect&ly-lang-detect=off
If the language detection of langify is enabled, you can append this param to an URL in order to force langify to turn off the language detection.
ly-force-off&ly-force-off=true
If this param is appended to an URL, the core won't initialize.