Use folder structure instead of underscores in filenames
[GitHub/WoltLab/woltlab.github.io.git] / docs / package / pip / language.md
1 # Language Package Installation Plugin
2
3 Registers new language items.
4
5 ## Components
6
7 !!! info "The `languagecode` attribute is required and should specify the [ISO-639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code."
8
9 The top level `<language>` node must contain a `languagecode` attribute.
10
11 ### `<category>`
12
13 Each category must contain a `name` attribute containing two or three components consisting of alphanumeric character only, separated by a single full stop (`.`, U+002E).
14
15 #### `<item>`
16
17 Each language item must contain a `name` attribute containing at least three components consisting of alphanumeric character only, separated by a single full stop (`.`, U+002E). The `name` of the parent `<category>` node followed by a full stop must be a prefix of the `<item>`’s `name`.
18
19 !!! info "Wrap the text content inside a CDATA to avoid escaping of special characters."
20 !!! warning "Do not use the `{lang}` tag inside a language item."
21
22 The text content of the `<item>` node is the value of the language item. Language items that are not in the `wcf.global` category support template scripting.
23
24 ## Example
25
26 ```xml
27 <?xml version="1.0" encoding="UTF-8"?>
28 <language xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/2019/language.xsd" languagecode="de">
29 <category name="wcf.example">
30 <item name="wcf.example.foo"><![CDATA[<strong>Look!</strong>]]></item>
31 </category>
32 </language>
33 ```