You are here: About Property Transfer > Main task descriptions > Configuration of PropertyTransfer from Kronodoc to Office documents > Support for different document languages

Support for different document languages

PropertyTransfer from Project Portal to Office documents can be configured to recognize the language of the Office document and set e.g. date formats in properties accordingly.

The custom property field (in Office document) is configured in mt_config.pm in the field languagefield of the hash map. The example below displays a configuration where the language is looked in the field Language in the OLE file custom properties for documents that have been created with any template KRONO_*.dot.

$map = {
    '^KRONO_.*(\.dot)?$' => { # wvmeta returns word templates without .dot      'applicationid' => "Word.Application.8",      'languagefield' => "Language", ...
 

Date formats to use are configured with the hash DocLocaleMap. The example below illustrates the configuration for using the date format YYYY-MM-DD for English documents (Language = English) and D.M.YYYY for Finnish documents (Language = Suomi).

$::DocLocaleMap = {
     'Suomi' => {'datefmt' => 'D.M.YYYY'},
     'English' => {'datefmt'=> 'YYYY-MM-DD'},
     };
        

The date conversion is with the dateconvert preprocessing rule in the map hash. Setting the output conversion format to filelocale will cause the format specified by the language to be used. The example below describes a configuration which converts the OLE contents to be stored into the field reldate into the date format specified by the language:

$map = {
     '^KRONO_.*(\.dot)?$' => { # wvmeta returns word templates without .dot
        'applicationid' => "Word.Application.8",
        'languagefield' => "Language",
        'preprocess' => {'reldate’ => [ 'dateconvert', YYYY-MM-DD’, 'filelocale’],
        },
        ‘properties’ => …
        

www.bluecieloecm.com