Language specific name and description for Tasks

General

This feature enables the storage of names for a task in different languages and also includes a fallback mechanism if the name in a specific language is not available.

Task names and descriptions will be shown in the language the user used to login to the client.

When a name is entered for the first time (in the client language) this will become the fallback name. So when another user logs in with another language that has not yet a value, the UI will show the name the first user maintained.

If someone stored a name in the client language a user logs in, the user will see that value and not the fallback.

Example:

Some users do the following actions in the order implied by the table.

User

Client language

Action

Note

Alice

English

creates a task with name "English task of Alice"

this becomes the fallback

Bob

German

sees a task with name "English task of Alice"

this is the fallback

Bob

German

changes the name to "German task of Alice"

maintains a value for German

Mike

German

sees a task with the name "German task of Alice"

Alice

English

renames the task to "Changed task of Alice"

this does not replace the fallback

Mike

Italian

sees a task with name "English task of Alice"

This is still the value for the fallback

Enabling language specific data

By default this feature is disabled to be compliant with older versions.

Product 360 Server

In order to enable the feature, set the logical key TaskLangType.LK.Language and the corresponding field TaskLangType.Language to editable = true in the repository.

images/download/attachments/200806400/image2019-7-30_14-39-46.png images/download/attachments/200806400/image2019-7-30_14-40-34.png

It makes sense to set the language field to visible = true as well.

You should also make sure that the names from top of the name and description field include the language qualification. A possible value can look like this: "Name ({TaskLangType.LK.Language#Language selectable})"

images/download/attachments/200806400/EnableLangDependentTaskNames_TaskNameFromTop.PNG images/download/attachments/200806400/EnableLangDependentTaskNames_TaskDescriptionFromTop.PNG

Supplier Portal

If supplier tasks are in general enabled using property global.permission.suppliertasks=ENABLED then the additional property task.languageDependent should be set to true in the configuration.properties file. With this configuration the user of Supplier Portal will see the name of task in the login language in the timeline messages. If language specific name not exists, then the fallback to language independent name will work.

Web UI

There are changes in list model and field form definitions in the Web UI regardless of the customer enabling the feature or not: task.listmodel.xml, task.create.form.xml, task.edit.form.xml, task.create.supplier.form.xml and task.edit.supplier.form.xml. The logical key to TaskLang have been added. Normally the new definitions are created during the P360 Server startup. But if any of these definitions have been adjusted for customer needs then the customized definitions should be actualized to have the logical key for name and description like this:

task.listmodel.xml with disabled feature
<definition defaultDefinition="true" i18NKey="%table.config.default" identifier="task.table.config.default" rootEntity="Task">
<field identifier="Task.TaskType" sortable="true" width="40"/>
<field identifier="TaskLang.Name" sortable="true">
<logicalKey identifier="TaskLangType.LK.Language" value="Language independent"/>
</field>
...
<field identifier="TaskLang.Description" sortable="false" width="100">
<logicalKey identifier="TaskLangType.LK.Language" value="Language independent"/>
</field>
...
</definition>
task.edit.form.xml with disabled feature
<definition i18NKey="" position="2147483647" rootEntity="Task">
<column>
<fieldGroup displaySectionWidget="true" subEntityId="TaskLang">
<field identifier="TaskLang.Name">
...
</field>
<field identifier="TaskLang.Description"/>
...
<logicalKey hidden="true" identifier="TaskLangType.LK.Language" value="Language independent"/>
</fieldGroup>
</column>
</definition>
task.listmodel.xml with enabled feature
<definition defaultDefinition="true" i18NKey="%table.config.default" identifier="task.table.config.default" rootEntity="Task">
<field identifier="Task.TaskType" sortable="true" width="40"/>
<field identifier="TaskLang.Name" sortable="true">
<logicalKey identifier="TaskLangType.LK.Language" value="${user.language}"/>
</field>
...
<field identifier="TaskLang.Description" sortable="false" width="100">
<logicalKey identifier="TaskLangType.LK.Language" value="${user.language}"/>
</field>
...
</definition>
task.edit.form.xml with enabled feature
<definition i18NKey="" position="2147483647" rootEntity="Task">
<column>
<fieldGroup displaySectionWidget="true" subEntityId="TaskLang">
<field identifier="TaskLang.Name">
...
</field>
<field identifier="TaskLang.Description"/>
...
<logicalKey identifier="TaskLangType.LK.Language" selectable="true" value="${user.language}"/>
</fieldGroup>
</column>
</definition>

If the task group name should be displayed in the Web UI adjust the list definition this way:

Task group name definition with disabled feature
...
<field caption="%web.task.type.TaskGroup" identifier="Task.Parent" sortable="true">
<logicalKey identifier="TaskLangType.LK.Language" value="Language independent"/>
<transitionField identifier="TaskLang.Name"/>
</field>
...
Task group name definition with enabled feature
...
<field caption="%web.task.type.TaskGroup" identifier="Task.Parent" sortable="true">
<logicalKey identifier="TaskLangType.LK.Language" value="${user.language}"/>
<transitionField identifier="TaskLang.Name"/>
</field>
...

The language logical key should be also added in the task flexible UI like this:

Task flexible UI detail data with disabled feature
...
<header headerStrategy="taskActionsHeader" />
<fieldFormDefinition rootEntity="Task">
<column>
<fieldGroup displaySectionWidget="true" subEntityId="TaskLang">
<field identifier="TaskLang.Name" />
<field identifier="TaskLang.Description" />
<logicalKey hidden="true" identifier="TaskLangType.LK.Language" value="Language independent" />
</fieldGroup>
<fieldGroup>
<field identifier="Task.CreationUser" />
<field identifier="Task.CreationDate" />
</fieldGroup>
</column>
...
</fieldFormDefinition>
Task flexible UI detail data with enabled feature
...
<header headerStrategy="taskActionsHeader" />
<fieldFormDefinition rootEntity="Task">
<column>
<fieldGroup displaySectionWidget="true" subEntityId="TaskLang">
<field identifier="TaskLang.Name" />
<field identifier="TaskLang.Description" />
<logicalKey hidden="true" identifier="TaskLangType.LK.Language" value="${user.language}" />
</fieldGroup>
<fieldGroup>
<field identifier="Task.CreationUser" />
<field identifier="Task.CreationDate" />
</fieldGroup>
</column>
...
</fieldFormDefinition>

Service API

When using the REST List API, keep in mind that Task.Name/Task.Description has been moved to TaskLang.Name/TaskLang.Description with the qualification 'language'.

When using the REST Management API for Tasks and the feature is enabled, a new element for language specific data called 'taskLangs" has been introduced. It must contain a language and can either contain a name and/or a description. In the response of a GET request you will find an additional entry for language independent (-1). This is the fallback for all languages without a name.

When the feature is disabled, there are no changes in the REST Management API.

Examples for enabled feature:

POST http://<server>:<port>/rest/V2.0/manage/task/

Task create body
{
"task": {
"taskType": "SingleTask",
"entity": "Article",
"user": "aSmith",
"responsible": "aSmith",
"accepted": "false",
"taskLangs": [
{
"language": "de_DE",
"name": "Meine Aufgabe",
"description": "Eine Beispielaufgabe"
},
{
"language": "English",
"name": "My english task",
"description": "An english task description"
}
]
}
}

POST http://<server>:<port>/rest/V2.0/manage/workflow

Create workflow body
{
"identifier": "TranslationWorkflow",
"label": "Translations Summer 2019",
"status": [
{
"status": "English Translations",
"workflowTask": {
"container": "1",
"containerEntityId": "MasterCatalog",
"entity": "Article",
"user": "aSmith",
"responsible": "aSmith",
"accepted": "false",
"taskLangs": [
{
"language": "German",
"name": "Übersetzung ins Englische",
"description": "Übersetzung des Sommerkatalogs 2019 ins Englische"
},
{
"language": "English",
"name": "Translation into English",
"description": "English translation of the summer catalog 2019"
}
]
}
}
]
}

GET http://<server>:<port>/rest/V2.0/manage/task/<task id>

Response
{
"taskLangs": [
{
"language": "9",
"name": "Translation into English",
"description": "English translation of the summer catalog 2019"
},
{
"language": "-1",
"name": "Übersetzung ins Englische",
"description": "Übersetzung des Sommerkatalogs 2019 ins Englische"
},
{
"language": "7",
"name": "Übersetzung ins Englische",
"description": "Übersetzung des Sommerkatalogs 2019 ins Englische"
}
],
"taskType": "SingleTask",
"priority": 1,
"notificationLevel": 1,
"creationDate": "2019-08-06T15:29:13:593+0200",
"escalationDate": "",
"deadline": "",
"finishEstimate": "",
"finishDate": "",
"progress": 0,
"dynamic": false,
"entity": "Article",
"displayOrder": 2147483647,
"creationUser": "aSmith",
"user": "aSmith",
"responsible": "aSmith",
"acceptanceDate": "",
"accepted": false,
"complete": false
}

Migration

There are changes in the repository and the database regardless of the customer enabling the feature or not.

There is a new DB table called TaskLang and all values (names and descriptions) will be moved to the new table using language independent (-1) as language.

This means, if the customer enables the feature, the former name of the task becomes the fallback for all other languages that don't have a value of their own, yet.

Additionally, flexible UI templates already saved inside the database will be updated automatically to a format as shown above in Task flexible UI detail data with disabled feature. When enabling this feature, flexible UI templates need to be adjusted manually. Note that during this process, the order of the task fields may change.

Limitations

Customizings

It is not recommended nor supported to build further custom entities on the entity type TaskLangType.

Task notification

The email for event "Header data changed" works only for changes in the same language. E.g. if the user in the German UI changes language independent name, which is displayed using fall-back as a German task name there will be notification having "Old value" empty and new German task name. The fall-back for empty language specific names won't be used here.
The language for changed values is not specified.

Fallback language

The default value of the logical key TaskLangType.LK.Language and the field TaskLangType.Language is set to -1.

-1 is the value used to indicate language independent. This value is used as fallback language as explained before. The value cannot be changed. If changed, the server won't start.

Qualified Field Rights

Qualified field rights are not considered for language specific data of tasks.