- Created by Robert Reiner, last modified on 09. Jul 2017
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 5 Next »
The plugin supports more than just EN (as default) and DE. But the Toolbox is limited to these locales.
- Audience
- Level of Experience
It is possible to add additional localization files to the plugin to make it support more locales than just EN and DE. But the projectdoc Toolbox currently only supports these two locales. This short tutorial shows nonetheless how the plugin supports the use of additional locales.
Use Localization in Descriptor Files
The plugin checks the supported locales on the first declared category in the Add-on Descriptor. The list of supported locales for this category is the list of expected locales for each space and doctype.
<add-on xmlns="http://smartics.de/xsd/projectdoc/add-on/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <categories> <category id="default"> <resource-bundle> <l7n> <name plural="My Main Categories">My Main Category</name> </l7n> <l7n locale="de"> <name plural="Meine Hauptkategorien">Meine Hauptkategorie</name> </l7n> </resource-bundle> </category> <category ...> ... </category> ... </categories> </add-on>
For spaces and doctypes locales are specified as attributes on the l7n
elements within the resource-bundle
element.
<resource-bundle> <l7n> <name>Sample Doctype</name> <description> For the page blueprint overview: A sample doctype's description. </description> <about> For the page wizard: Tell users what this doctype is for. </about> </l7n> <l7n locale="de"> <name plural="Beispiel-Dokumenttypen">Beispiel-Dokumenttyp</name> <description> Für die Page-Blueprint-Übersicht: Die Beschreibung für den Beispiel-Dokumenttyp. </description> <about> Für den Page-Wizard: Erläutern Sie, welchen Zweck dieser Dokumenttyp erfüllt. </about> <type plural="Beispiel-Dokumenttyp-Typen">Beispiel-Dokumenttyp-Typ</type> </l7n> </resource-bundle>
Localization with Template Fragments
The localization files are provided separately for each space or doctype base template. If a locale is not supported, the resource for the default locale is returned.
Spaces
The localized resources for doctypes are stored per locale in the project folder at
src/main/resources/spaces/[id of space descriptor]/l7n_[locale].properties
# Space Wizard for ${space.name} ############################################## projectdoc.${shortId}.blueprints.space.blueprint.name=${space.name} projectdoc.${shortId}.blueprints.blueprint.description=${space.description} projectdoc.${shortId}.blueprints.blueprint.dialog.choose.title=Create a ${space.name} projectdoc.${shortId}.blueprints.blueprint.dialog.choose.heading=${space.name} projectdoc.${shortId}.blueprints.blueprint.dialog.choose.description=${space.about}
Currently only one space per generated add-on project is supported.
Doctypes
The localized resources for doctypes are stored per locale in the project folder at
src/main/resources/doctypes/[id of the base template]/fragments/l7n_[locale].properties
## ${doctypeNameLabel} ............................................................ ### Documentation URLs projectdoc.url.${doctypeId}=${doctypeNameLabel.urlPart} projectdoc.url.${doctypeId}.label=${doctypeNameLabel} projectdoc.url.${doctypeId}.title=Documentation on the ${doctypeNameLabel} doctype ### Home and Index Pages projectdoc.doctype.${doctypeId}.home=${doctypeNameLabel.plural} projectdoc.content.${doctypeId}.home.title=${doctypeNameLabel.plural} projectdoc.content.${doctypeId}.home.description=Homepage of ${doctypeNameLabel.plural.lower} projectdoc.content.${doctypeId}.home.roots-only.title=${doctypeNameLabel.plural} projectdoc.content.${doctypeId}.home.roots-only.desc=List of central ${doctypeNameLabel.plural.lower}. projectdoc.content.${doctypeId}.index.all.title=All ${doctypeNameLabel.plural} projectdoc.content.${doctypeId}.index.all.desc=List of all ${doctypeNameLabel.plural.lower}. ### Template projectdoc.${doctypeId}.template.title=${doctypeNameLabel} projectdoc.doctype.${doctypeId}.children=Subordinate ${doctypeNameLabel.plural} ### Blueprint projectdoc.blueprint.${doctypeId}.title=${doctypeNameLabel} projectdoc.${doctypeId}.create-link.title=${doctypeNameLabel} #projectdoc.${doctypeId}.create-link.description=Create ${doctypeNameLabel} projectdoc-doctype.blueprint.wizard.${doctypeId}.page1.title=Create a ${doctypeNameLabel} projectdoc-doctype.blueprint.wizard.${doctypeId}.page1.desc.header=About ${doctypeNameLabel.plural} projectdoc.doctype.${doctypeId}.create.label=Create ${doctypeNameLabel}
- No labels