Language Definition"
Line 18: | Line 18: | ||
A language addon is used to extend a language definition. You need to include it in one of the following ways: | A language addon is used to extend a language definition. You need to include it in one of the following ways: | ||
− | * Load by path convention at <code>/WEB-INF/classes/metainfo/zk/lang-addon.xml</code>, available to the classpath. The filename must be the same as specified. | + | * Load by path convention at <code>/WEB-INF/classes/metainfo/zk/lang-addon.xml</code> in a WAR, available to the classpath. In jar, <code>mymodule.jar/metainfo/zk/lang-addon.xml</code>. The filename must be the same as specified. |
* specified the file path with [[ZK_Configuration_Reference/zk.xml/The_language-config_Element| <language-config> in zk.xml]] (in a Web application) | * specified the file path with [[ZK_Configuration_Reference/zk.xml/The_language-config_Element| <language-config> in zk.xml]] (in a Web application) | ||
* specified the file path in [[ZK Configuration Reference/JAR File's config.xml/The language-config Element|/metainfo/zk/config.xml]] (in a JAR file; classpath). | * specified the file path in [[ZK Configuration Reference/JAR File's config.xml/The language-config Element|/metainfo/zk/config.xml]] (in a JAR file; classpath). |
Revision as of 08:52, 29 May 2023
This section describes what a language definition and addon are. It is required for component development. However, you could skip it if you won't develop components. For more information about component development, please refer to ZK Component Development Essentials.
If you would like to change the default configuration of a ZK application, please refer to ZK Developer's Reference: Packing Code.
Language Definition
A language definition defines a component set (aka., a language). For example, ZUL and XHTML are two component sets.
To define a language definition, you have to prepare a file called /metainfo/zk/lang.xml
and make it available to the classpath (such as in a JAR file, or in WEB-INF/classes of a Web application). In addition, you could specify them in /metainfo/zk/config.xml in the classpath. (parsed by org.zkoss.zk.ui.metainfo.DefinitionLoaders)
Language Addon
A language addon is used to extend a language definition. You need to include it in one of the following ways:
- Load by path convention at
/WEB-INF/classes/metainfo/zk/lang-addon.xml
in a WAR, available to the classpath. In jar,mymodule.jar/metainfo/zk/lang-addon.xml
. The filename must be the same as specified. - specified the file path with <language-config> in zk.xml (in a Web application)
- specified the file path in /metainfo/zk/config.xml (in a JAR file; classpath).
When ZK starts, it will parse all language definitions and then all language add-ons based on their dependency. A language addon is a variant of a language definition. They are almost the same, except for the naming and it must specify the <addon-name>.