Services

Localization

Snipshot Services provides a way for you to change any of the text visible in the editor in order to fit it to your particular locale. This could mean changing the text to a different language—French, German, Chinese—or it could mean using different terminology—"Enhance" becomes "Normalize", "Adjust" becomes "Tweak", and so on. Try out Snipshot in German and French thanks to Humyo.

Locale information is submitted to Snipshot in the parameter snipshot_locale, which should contain the address to a Snipshot locale file. The locale file is expected to be a valid JSON document that contains two special objects, innerText and titleText. The contents of a sample locale file are printed below. Be sure to save your locale file with UTF-8 encoding if you want to use non-ASCII characters such as ü or ç.

Sample locale file contents
{
  "innerText" : {
    "undo": "Retour",
    "resize": "Transform",
    "crop": "Coup",
    "enhance": "Augment",
    "adjust": "Ajuste",
    "open": "Ouvre",
    "save": "Garde"
  },
  
  "titleText" : {
    "undo": "Retour",
    "resize": "Transform",
    "crop": "Coup",
    "enhance": "Augment",
    "adjust": "Ajuste",
    "open": "Ouvre",
    "save": "Garde"
  }
}

The two objects are for replacing two different kinds of text in the Snipshot editor. innerText is for replacing text that is visible as part of the page. titleText is for replacing the tooltip text that appears when you hover the mouse cursor over an element with a title attribute. The exact rules of operation are:

  1. Snipshot will replace the first textnode of document[id] or one of its children with innerText[id].
  2. Snipshot will replace the title attribute of document[id] or one its children with titleText[id].

To see all the text that you can replace, look at the HTML source code of the Snipshot editor. Any textnode or title text should be replaceable by referring to a parent element.