How to translate phase change activity.

  • KM03050878
  • 20-Dec-2017
  • 02-Apr-2021

Summary

How to translate phase change activity.

Question

One of the things that need to be translated manually in a localized system are the activities. The following steps will help to translate the phases in the Change Phase activity description for the incidents

Answer

1.    Create a ScriptLibrary with name “translate_phase” and add the following code. In this case, the function in the ScriptLibrary will receive 3 parameters, but the function can be adjusted depending on the requirements:

function translate(phase, module, table){
var strConcat;
strConcat = phase+";"+module+";"+table;
return system.functions.scmsg(""+strConcat+"","local:WorkflowPhase")
}


2.    After creating the Script, the activities need to call it in order to translate the phase:
        2.1.    Go to the database manager and look for the activityactions table.
        2.2.    Then in the Name field, type “Save Activities” and in Table field type “incidents”.
        2.3.    Translate the text under Name column and add the following code under Description:

{"Cambio de Fase de  \"" + jscall("translate_phase.translate",nullsub(current.phase in $L.file.save,"NONE"), "Incident","probsummary" ) + "\" a \"" + jscall("translate_phase.translate",nullsub(current.phase in $L.file,"NONE"), "Incident","probsummary")+"\""}

       2.4.    The translated text is done based on the OOB information, but it can be adjusted. The activity will look like:
image text
NOTE: This example is translating one activity so it has been replaced. If the system uses multilanguage, there should be one activity for each language, and the condition should be adjusted to use the current user language.