Datapolis Process System SDK

Search:

Contents
:
IndexBookmarkPrint
Home > Functions > Multilanguage in Functions

Multilanguage in Functions

 

 

You can create multilanguage function. It means that on site with different languages it will be shown different in Workflow Designer. To prepare that you need:

  • Create Resx files
  • Fill *.Functions.xml and *.Functions.Categories.xml files with resx entries
  • Convert Resx to *.resources files

Finally your *.resources files should be located in 15/WorkBox/Functions folder with your *.Functions.xml and *.Functions.Categories.xml files.

 

Resx files


You have to prepare standard Resx files in your project. For example files may look as below:

 

WBHour.Functions.resx

 

<data name="FunctionCategoryDate" xml:space="preserve">
  <value>SDK Date</value>
</data>
 
<data name="WBHour_FunctionDescription" xml:space="preserve">
  <value>Returns the hour of a time value. The hour is given as an integer, ranging from 0 (12:00 A.M.) to 23 (11:00 P.M.).</value>
</data>
<data name="WBHour_FunctionTitle" xml:space="preserve">
  <value>Hour</value>
</data>
<data name="WBHour_Value_Description" xml:space="preserve">
  <value>Enter the date that contains the hour you want to find.</value>
</data>
<data name="WBHour_Value_Title" xml:space="preserve">
  <value>Date</value>
</data>

 

WBHour.Functions.pl-PL.resx

<data name="FunctionCategoryDate" xml:space="preserve">
  <value>SDK Funkcje daty</value>
</data>
 
<data name="WBHour_FunctionDescription" xml:space="preserve">
  <value>Zwraca godzinę w postaci numeru seryjnego. Godzina jest określona liczbą całkowitą z zakresu od 0 do 23.</value>
</data>
<data name="WBHour_FunctionTitle" xml:space="preserve">
  <value>Godzina</value>
</data>
<data name="WBHour_Value_Description" xml:space="preserve">
  <value>Określa datę, z której chcesz uzyskać godzinę.</value>
</data>
<data name="WBHour_Value_Title" xml:space="preserve">
  <value>Data</value>
</data>

 

Fill xml files


You need then to use your resx strings in you xml files. Each resx string can be used this way: $Resources:<Resx File name without extensions>,<resx name>;

I.e.: $Resources:Datapolis.WorkBox.Sdk.Samples.Functions,WBHour_FunctionTitle;

 

For example function file may look as below:

 
  <Function Name="Datapolis.WorkBox.Sdk.Samples.Functions.WBHour" Title="$Resources:Datapolis.WorkBox.Sdk.Samples.Functions,WBHour_FunctionTitle;" Description="$Resources:Datapolis.WorkBox.Sdk.Samples.Functions,WBHour_FunctionDescription;" Assembly="Datapolis.WorkBox.Sdk.Samples, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0a68baededa28155" Category="SDK.Date">
    <Parameter Name="Value" Title="$Resources:Datapolis.WorkBox.Sdk.Samples.Functions,WBHour_Value_Title;" Description="$Resources:Datapolis.WorkBox.Sdk.Samples.Functions,WBHour_Value_Description;" Type="String"></Parameter>
  </Function>
 
</Functions>

 

Converting to *.resources


The simplest way is to add post build event that use ResGen.exe (standard .NET Framework tool) to convert resx to *.resouce.

I.e. ResGen.exe WBHour.Functions.resx WBHour.Functions.resources

 

Then remember to put generated file in 15/WorkBox/Functions folder.