Modifying the output / Using localized strings |
Use the fgl_report_configureLocalization function to change the directory where the program seeks the translation files and to change the formatting pattern for numerical data at runtime.
$echo $FGLPROFILE fglprofile $cat $FGLPROFILE fglrun.localization.file.count = 2 fglrun.localization.file.1.name = "captions.42s" fglrun.localization.file.2.name = "mappings.42s" $find translation_files translation_files translation_files/en translation_files/en/captions.str translation_files/en/captions.42s translation_files/fr translation_files/fr/captions.str translation_files/fr/captions.42s translation_files/common translation_files/common/mappings.str translation_files/common/mappings.42s $cat test.4gl MAIN ... #select French translation LET handler=configureReport(“translation_files/fr:translation_files/common”); START REPORT invoice TO XML HANDLER handler ... END MAIN ... FUNCTION configureReport(resourcePath) ... LET handler=fgl_report_loadCurrentSettings(“localizable_invoice.4rp”) ... CALL fgl_report_configureLocalization(NULL,resourcePath,NULL,NULL) ... RETURN fgl_report_commitCurrentSettings() END FUNCTION ...
$echo $DBFORMAT $:,:.: $cat test.4gl MAIN ... #select German number formatting LET handler=configureReport(“:.:,:EUR”); START REPORT invoice TO XML HANDLER handler ... END MAIN ... FUNCTION configureReport(numberFormat) ... LET handler=fgl_report_loadCurrentSettings(“invoice.4rp”) ... CALL fgl_report_configureLocalization(NULL,NULL,numberFormat,NULL) ... RETURN fgl_report_commitCurrentSettings() END FUNCTION ...