LanguageResource protocol
Summary
The LanguageResource protocol and the types that implement it
(InstallableKeyboard and InstallableLexicalModel) represent keyboards and
lexical models installed within Keyman Engine.
Generally speaking, this is a lower-level type than
LanguageResourceFullID, requiring extra metadata
only discovered during installation from a resource's package and only used
internally within Keyman Engine.
Syntax
LanguageResource.fieldName
Description
The LanguageResource protocol is the base type used to represent specific
types of installed resources within Keyman Engine, paired with their target
languages. Both InstallableKeyboard and InstallableLexicalModel implement
this protocol, allowing methods to be written that can handle either resource
type. Also note the existence of AnyLanguageResource, which serves a "type
erasure" role for classes implementing this protocol.
Important note: multiple copies of LanguageResource for the same underlying
resource will exist if that resource has been installed for use with multiple
languages. One instance will exist per target language that was selected for
installation.
Associated Types
FullID: LanguageResourceFullIDThe
LanguageResourceFullIDtype used to uniquely identify the resource, comprised of the resource's ID, type, and paired language code. Frequently used within the engine as a unique identifier for the resource in searches and comparisons.Package: KeymanPackageThe derived type of KeymanPackage supporting this type of resource.
For example, InstallableKeyboard.Package == KeyboardKeymanPackage.
Fields
id: StringThe resource's internal name. This must be unique among all resources of the same type and follows standard unique ID constraints: a-z, A-Z, 0-9, and underscores only.
name: StringThe resource's external name, as displayed to users.
languageID: StringOne language paired with this resource during installation.
packageID: String?The ID of the resource's source package. Is 'optional' for legacy reasons.
packageKey:KeymanPackage.KeyThe unique identifier for the resource's source package.
version: StringThe resource's installed version.
sourceFilename: StringThe filename of the package component used internally within Keyman Engine to load the resource.
fullID:AnyLanguageResourceFullIDA unique identifier used in language resource searches and comparisons.
History
While the classes that implement the protocol existed before this, the protocol itself was added in Keyman Engine for iPhone and iPad 14.0.
See Also
KeymanPackageRepresents packages containing language resources.
LanguageResourceFullIDUnique identifiers used in language resource searches and comparisons.


