-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library of localized label/hint/help/alert messages #3120
Comments
Open questions:
|
Editing resourcesForm Builder presents the user with a new button, link or URL to a new page or dialog which allows adding, removing, and modifying labels, hints, help resources, and alert resources. We call this the Resources Library Editor. A resource is identified by a name or key, which can contain periods to indicate an optional hierarchy, and a value, which is the resource or message in a particular language. Each resource with a given key can also be localized in any number of languages so that one value per language is available. The set of keys and values constitutes the Resources Library. When the Resources Library is saved, it becomes available to the form author in Form Builder, and to existing published form definitions. [NOTE: We can consider an option to make the updating of resources for a given form definition a separate step.] In the first version of this feature, there is a single Resources Library, shared among all form definitions. From the Resources Library Editor, it is possible to export all existing resources to XML, and to import resources from an XML file. The exact format remains to be defined. From an implementation point of view, the resources are edited with a special singleton form called “orbeon/resources”, and the associated data is stored in the Form Runner database. In a first version, removing or renaming a resource key which is in use in a given form definition does not cause those form definitions to be updated. Therefore the form author must be careful when renaming or removing resource keys. Using resourcesIn Form Builder, when editing labels, hints, help and alert messages, a way is provided to use one of the Resources Library resources instead of entering a text directly. The user does this by selecting the key of the resource to use. Some help is provided to select a key, with a dropdown and/or autocompletion list. After associating a key for the given resource, all languages present in the associated resource are automatically available. When the form author changes the form definition language, the given resource, when it is a label or hint, switches as it usually does when the label or hint is entered directly. Form definition optionsWe suggest in the first version of the feature to disallow mix-and-match, in a given form definition, of resources entered directly and resources entered via the Resources Library. An option is provided to configure a form definition to use one mode or the other. Internal format of the resourcesWhen the form definition uses resources from the Resources Library, the standard “resources instances” of the form definition contains a cacheable, read-only version of the Resources Library instead of the inline resources as is the case now. OtherThe standard Form Runner persistence API can be used to read and write the resources in XML format. This works as it would for other form data, except that the XML will be in a particular format appropriate for the resources. The caller of the API will need to know the “document id” of the resources document. A translation system would GET the XML document, make changes to it, and then PUT it back with the changes. |
Questions:
|
I think we are contemplating that, like for section templates, resources from the Resources Library that are in use by a given form would be embedded at publish time. This would probably follow the principle of least surprise. Updating resources would require republishing the form from Form Builder, or from the Home page. The Home page could even have an action specific to just update resources (P2). |
The idea would be to allow to create a localized "Name" label, for example, and
DnDassociate it with a given form control. Then the label would come in with all existing translations.Questions/ideas:
JSON/Java resource bundleslaterfr:r()
in controls instead ofxxf:r()
to refer to a resource.+1 from evaluator
The text was updated successfully, but these errors were encountered: