Was this page helpful?

Retrieve Localized Resource String

    Description of the code sample

    The following command retrieves a specified, localized resource string. In this context, a resource is a file containing a list of strings paired keys representing MindTouch UI text instructions. Each language has its own unique resource file. The language can be be set in the "lang" parameter. The resource string key is defined through the "resource" parameter. The resource documents are located on the MindTouch file system. If a requested resource does not exist, a 404 Not Found HTTP response will be returned.

    The following sample will fetch a German (de) resource string for key [Login] error.auth (represented as login.error.auth):

    Sample Code

    curl -u username:password -i http://mindtouch.address/@api/deki/site/localization?lang=de&resource=login.error.auth

    Sample Response from executing Code

    Content-Type: text/plain

    Ungültiger Benutzername oder Passwort angegeben!

    Implementation notes 

    curl flags

    -u
    Provides external user authentication.
    -i
    Outputs the HTTP response headers. Useful for debugging.
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by