- Overview
- Examples

Overview

This section provides an overview of the syntax to use when working with localization directives. A localization directive is a specialized comment placed in a source document to provide filters with processing localization-related information.

For example you can use localization directives to indicate which strings are to localize in a JavaScript source where there are many string, some to translate and some to leave alone. Most Okapi filters support this mechanism.

Syntax and Behavior:

The following directives are available:

Directive Description
_skip Skip. Next text entry is not translatable.
_text Text. Next text entry is translatable.
_bskip Begin Skip. All next text entries until the next _eskip directive are not translatable.
_eskip End Skip. Closes a section of not translatable entries.
_btext Begin Text. All next text entries until the next _etext directive are translatable.
_etext End Text. Closes a section of translatable entries.

Examples

Example 1 Directives in a Java Properties file (with '!' and "#" as comments):

key1 = Something to translate
!_skip
key2 = Something not to translate
key3 = Something to translate
#_bskip
key4 = Something not to translate
!_text
key5 = Something to translate
key6 = Something not to translate
!_eskip

Example 2 Directives in an <script> element in JavaScript, inside an HTML file:

<SCRIPT type="text/javascript">
<!-- to hide script contents from old browsers
function square(i)
{
document.write("The call passed ", i ," to the function.", /*_skip*/ "<BR>") return i * i
}
document.write("The function returned ",square(5),".")
// end hiding contents from old browsers --> </SCRIPT>