JavaScript Externalized Strings

As described in Externalized Strings, all string values in JavaScript files should be externalized to JavaScript property files (.js.properties files).

By convention the name of the resource file for your JavaScript must be derived from name of the.js file itself. For example if your JavaScript file is called SomeJSFile.js then related localizable resources should be placed in SomeJSFile.js.properties file. A *.js.properties file can be placed anywhere in the component directory, but by convention it should be in the same directory as the related *.js file.

The exception to this is that a *.js file within a WebContent directory cannot have its associated *.js.properties file within the same directory. The associated *.js.properties file must be placed within a directory outside of the WebContent directory. To add localized JavaScript properties files, please see Locales.

JavaScript Properties files with the same name across all components will be merged together during processing. Any property with the same name will be overwritten by the highest component in the component order.

The use of placeholders within a property value is supported. The placeholders must be in the format %ns or '%ns' where n represents an integer from 1...n, and n must be within a defined range. The range is defined by the number of of placeholders used within a property value. For example, if there are three placeholders within a property value then the placeholders must be numbered from 1 to 3 (e.g. %1s, %2s, %3s) and anything outside of this range is not supported.