Skip to main content


 

Symptoms

 


It may be necessary to do localisation/customization for K2 smatrfroms error messages.

 

For example you may want to customize error messages which are being thrown to users on SmartForms for certain SmartForms exceptions, such as:

 

 

 

"24411 K2:DOMAINUser from XX.YY.ZZ.XX:YYYY is not allowed to open the worklist item with SN=XXXXX_X"

 

 

 

More often than not such error messages are incomprehensible for users. Consequently you may want to customize text of those error messages (to make them more user friendly/actionable for users) in a centralized fashion (system wide) as well as perform logging of such errors (e.g. into table in DB or in event logs) for proactive monitoring of errors.

 

 

 

See Diagnosis section for details on how to accomplish this.
 

 

Diagnoses

 


First of all there are Language Packs available for SmartForms which can be found in K2 smartforms downloads section on portal.k2.com (scroll down till you locate "Language Pack (Preview)" section).

Currently the following Language Packs are available:

 


Deutsch (German)
Français (French)
简体中国 (Simplified Chinese)
中國傳統 (Traditional Chinese)
Afrikaans
Italian
Portuguese
Spanish
Hebrew
Czech

There is an existing feature request to create Russian language pack but there is no clear ETA for it as for now.

 

 

 

System-wide customization of such error messages at the moment is possible by editing HostServerLogging.config. This is the only supported option for SmartForm 1.0.5 and earlier versions. Unfortunately set of error messages which you can customize with use of this method is limited by errors mentioned in this file HostServerLogging.config
For the customization of the rest of the error messages as well as logging part there is an existing feature request (TFS 589112) with no ETA defined at the moment.

Without language pack certain things can be translated/customized but not everything:
- Error messages when format is incorrect in a textbox (in the red bubble) - in case when error message is not compiled then it is possible to translate it. E.g. if you entering "ABCD" into the calendar control, it throws the error “The date is invalid or in an incorrect format”. It is possible to localize this text by making a copy of:
$Program Files/K2 blackpearl/K2 smartforms Runtime/App_Globalresources/RuntimeMessages.resx
And pasting/renaming/translating it into:
$Program Files/K2 blackpearl/K2 smartforms Runtime/App_Globalresources/{language_code}/RuntimeMessages.{language_code}.resx
Some controls use error messages compiled into the Smartforms assembly and we don't support any modifications of these. Also many error messages are sourced from Blackpearl (around 2500 error messages) - it is planned to localize those in future releases (post 4.6.9).

- Default labels (in the picker control popup for example) - most strings are compiled into dll (SourceCode.Forms.Controls.Web.dll) and we do not support changing this by customers.

- the "add new row" under a list - also compiled into dll (SourceCode.Forms.Rendering.Web.dll) and can not be modified by customer.

Specifically to change error messages it is necessary to do the following:
Copy the following file
$Program FilesK2 blackpearlK2 smartforms RuntimeApp_GlobalresourcesRuntimeMessages.resx
Into new subfolder which has a name which match Language Code (e.g. "ru-RU"), also renaming the file so that it contains language code too:
$Program FilesK2 blackpearlK2 smartforms RuntimeApp_Globalresources{language_code}RuntimeMessages.{language_code}.resx

After making these changes it is necessary to perform iisreset and clear browser cache on the client. It is also necessary to have Russian language settings configured on the client side so that browser knows that it should select your preferred language. This means that you have to go to Control Pane > Language and make sure that your language is added there and located on the top of the list.


Additionally there are possible cases when these changes not being picked up by client despite performing IIS reset and clearing cache by using normal IE settings dialog (Ctrl Shift Del). In such case it helps to access IE F12 tools and use either "Always refresh from server" option or "Clear browser cache..." Please refer to the following section of MSDN for details on using Cache Menu in IE Developer tools:
https://msdn.microsoft.com/en-us/library/hh968260(v=vs.85).aspx_cacheMenu
 

 

Resolution

See Diagnosis section for details on available Language Packs as well on steps required to customize error messages for languages which do not have Language Pack available.

 

 



 
Be the first to reply!

Reply