Specifications
a "generic" language that may be used if there is no specific language match. The generic
language must be a valid RFC 3066 primary subtag or the empty string.
For example, a specific language of "en-US" should be used in the US, and a specific language
of "en-UK" should be used in England. It is also appropriate to use "en" as the generic language
in each case. If a US document goes to England, the "en-US" title is selected by using the "en"
generic language and the "en-UK" specific language.
It is considered poor practice, but allowed, to pass a specific language that is just an RFC 3066
primary tag. For example "en" is not a good specific language, it should only be used as a generic
language. Passing "i" or "x" as the generic language is also considered poor practice but allowed.
RFC 3066 language tags must be treated in a case insensitive manner.
The XMP specification defines an artificial language, "x-default", that is used to explicitly denote
a default item in an alt-text array. The localized text functions have several special features
related to the x-default item.
The selection of the array item is performed as follows:
• Look for an exact match with the specific language.
• If a generic language is given, look for a partial match.
• Look for an x-default item.
• Choose the first item.
A partial match with the generic language is where the start of the item's language matches the
generic string and the next character is '-'. An exact match is also recognized as a degenerate
case.
It is fine to pass x-default as the specific language. In this case, selection of an x-default item
is an exact match by the first rule, not a selection by the 3rd rule. The last 2 rules are fallbacks
used when the specific and generic languages fail to produce a match.
Returns the localized string in the specified
alt-text array selected according to the rules
getLocalizedText( xmp-path : String,
prefix-map : Map, genericLang : String,
specificLang: String ) : String
described above or null if there is no such string
(even no default).
Updating properties
The functions described in this section are available only for writable datasets, that is, datasets
for which the isWritable() function returns true. Invoking any of these functions on a non-writable
dataset is a programming error and has unpredictable results.
Finishing
Flushes any unsaved metadata changes to the backing file, closes the
backing file, and turns the dataset into a read-only dataset. From now
finishWriting( )
on, the isWritable() function returns false and further updates are
impossible.
A writable dataset keeps its backing file open for updating after the dataset is created. Since the
backing file is the current job (or a file in the job folder), it is necessary to close it before
attempting to move or process job in any way. In practice it is seldom necessary to explicitly call
the finishWriting() function because Switch automatically invokes it on the embedded dataset
for a job at the following times:
• When one of the Job.sendTo() or Job.fail() functions is invoked on the job.
483
Enfocus Switch 10