WinJS.Resources.getString function

0 out of 1 rated this helpful - Rate this topic

Retrieves the resource string that has the specified resource identifier.

Syntax


var object = WinJS.Resources.getString(resourceId);

Parameters

resourceId

Type: String

The resource ID of the string to retrieve.

Return value

Type: Object

An object that can contain these properties:

value

The value of the requested string. This property is always present.

empty

A value that specifies whether the requested string wasn't found. If it's true, the string wasn't found. If it's false or undefined, the requested string was found.

lang

The language of the string, if specified. This property is present only for multi-language resources.

Examples

This example is based on scenario 3 of the Application resources and localization sample. See the sample for the more complete solution.


var statusDiv = document.getElementById("statusMessage");
var str = WinJS.Resources.getString('scenario3Message');
statusDiv.textContent = str.value;
statusDiv.lang = str.lang; // Set the lang attribute to ensure proper font choice.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Namespace

WinJS.Resources

Library

Base.js

See also

WinJS.Resources
Application resources and localization sample

 

 

Build date: 12/5/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.