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 |
|
See also
Build date: 12/5/2012