Fork me on GitHub

OpenSeadragon 5.0.1

example: customize the tooltips and errors

The default strings are as follows

var I18N = {
  Errors: {
    Dzc:            "Sorry, we don't support Deep Zoom Collections!",
    Dzi:            "Hmm, this doesn't appear to be a valid Deep Zoom Image.",
    Xml:            "Hmm, this doesn't appear to be a valid Deep Zoom Image.",
    ImageFormat:    "Sorry, we don't support {0}-based Deep Zoom Images.",
    Security:       "It looks like a security restriction stopped us from " +
                    "loading this Deep Zoom Image.",
    Status:         "This space unintentionally left blank ({0} {1}).",
    OpenFailed:     "Unable to open {0}: {1}"
  },

  Tooltips: {
    FullPage:       "Toggle full page",
    Home:           "Go home",
    ZoomIn:         "Zoom in",
    ZoomOut:        "Zoom out",
    NextPage:       "Next page",
    PreviousPage:   "Previous page",
    RotateLeft:     "Rotate left",
    RotateRight:    "Rotate right"
  }
};



The OpenSeadragon Tooltips and Errors are in English by default.

Tooltip and Errors customization

Tooltip and string customization

In this example the tooltips of the buttons for Home, ZoomOut, ZoomIn and Fullpage, have been translated into Thai using OpenSeadragon.setString().

(Hover the mouse over the buttons to see tooltip)

Code

   
   OpenSeadragon.setString("Tooltips.Home","จัดรูปไว้กลางจอ");
   OpenSeadragon.setString("Tooltips.ZoomOut","ย่อ");
   OpenSeadragon.setString("Tooltips.ZoomIn", "ขยาย");
   OpenSeadragon.setString("Tooltips.FullPage","เต็มจอ");

   OpenSeadragon({
    ...
  });