PrizmDoc® Viewer v13.28 Release - Updated
PrizmDoc Viewer / API Reference / Viewer Control / Namespace: PCCViewer / Namespace: Language
In This Topic
    Namespace: Language
    In This Topic

    PCCViewer. Language

    A global object that defines the language data used by the PrizmDoc Viewing Client.

    Example

    // The PCCViewer.Language object can be initialized from a hash.
    PCCViewer.Language.initializeData({
     "addComment": "Add Comment",
     "advancedSearch": "Advanced Search Options",
     "annotateLabel": "Annotate"
     // ...
    });
    
    // Later, we can get any data by key.
    var myValue = PCCViewer.Language.getValue("annotateLabel");
    
    

    Methods

    getData() → {Object}

    Returns the hash representing the language data.

    Returns:

    The hash representing the language data.

    Type
    Object

    getValue(key) → {String|Object}

    Gets the value from the Language data object with the given key or returns the key.

    This method evaluates dots (‘.’) in the key, looking for a child object if a dot is seen. This method provides a convenience over directly accessing the data object because it will return the key instead of returning undefined or throwing in cases where an object is not defined.

    Example

    var myValue;
    
    // Look up language data by a string key
    myValue = PCCViewer.Language.getValue("annotateLabel");
    
    // Look up language data using a key with dot notation.
    myValue = PCCViewer.Language.getValue("printDialog.title");
    
    

    Parameters:

    Name Type Description
    key string

    Look up language data for this key. The key is a string, which uses dot notation to specify sub-keys.

    Throws:

    If language data is undefined.

    Type
    Error

    Returns:

    Type
    String | Object

    initializeData(languageData)

    Sets the language data from a hash.

    Example

    // The PCCViewer.Language object can be initialized from a hash.
    PCCViewer.Language.initializeData({
     "addComment": "Add Comment",
     "advancedSearch": "Advanced Search Options",
     "annotateLabel": "Annotate"
     // ...
    });
    
    

    Parameters:

    Name Type Description
    languageData object

    A hash representing the language data.


    Documentation generated by JSDoc 3.6.10 on Sun Feb 25 2024 19:35:19 GMT+0000 (Coordinated Universal Time)