In this post, I will show how to make a single simple WORD template for a multilanguage application. Thanks to this you will be able to save a lot of time when creating and maintaining templates.
Multilingualism in BPS: A step forward
WEBCON BPS has recently implemented many functions and mechanisms related to the usage of WEBCON in a multilingual company. For example, a few years ago the use of WEBCON for this purpose (multilingual company app) was really challenging in this field.
At this moment, I could not find an element in the system that could not be translated in WEBCON Designer Studio. Moreover, additional features have appeared – just like Multilingual choice fields which allow us to translate dictionary values of form field based on user language context.
However, there may still be situations, where it is necessary to do a lot of work so that the final result is satisfactory. For example, in case you need to generate an attachment or print a document as part of the process? Usually, in such cases, it was necessary to prepare a dedicated template for each language. As a result in an application with many languages, creating and maintaining such an application can be troublesome.
In today’s article, I will try to prove that creating an application for multilingual applications does not always have to involve the creation of multiple templates. It will show that you can easily generate a template with all the data from the form along with the names of the attributes in the language used by the user. What’s more, I will use only one docx template!
Firstly – Translation
Each form field that we want to use in the template should be translated. To achieve this, you can use the translation tool described in this post. Alternatively, you can always do it from WEBCON BPS Designer Studio.
To display the translation window for a form field, click on the icon in the screenshot below.
Secondly – The SQL function
To make that task simpler, I prepared a scalar-valued function that returns the form field name based on the user’s language context.
If the system does not have a translation in a given language, the function returns the form field name defined in Designer Studio.
Below is the body of the SQL function that has been applied.
Thirdly – Business rule
I have packed the function above into a business rule. Thanks to this, you can use a parameterized business rule in a more user-friendly way.
Fourthly – Business rule for each form field
Unfortunately – WEBCON BPS does not have a standard way to retrieve the form field name in the WORD addin. Therefore, using the previously prepared business rule, you may prepare dedicated business rules for each form field. Thanks to this, you will be able to use them in WORD addin.
And finally – WORD template
Below is an example of the WORD template that I created for this article. In the right panel, you can see that the business rules created in Designer Studio are available.
Summary
Thanks to the presented method you can easily prepare simple WORD templates. But you have to know that the method described above will not be suitable for all applications. However, it allows you to save a lot of time for simple and uncomplicated templates.