PDA

View Full Version : Changing the compilation language



Oscar
24-Apr-2017, 11:40 AM
Hi,

I usually create english based program with DF... I am currently working on a project that will be only (at least for now) in Spanish... I was looking at the help for language translation and it does require to copy the <language forlder>\pkg to the <dataflex folder>\pkg
The problem if I do that is that it will be a pain to move from english to spanish when I work on different projects. And forget about multi-tasking (which is the only way I know how to task)

I hope there is another way to do this... otherwise I would like to add a suggestion to make it into a next revision of DF... maybe with a compiler directive like "#SETLANGUAGE Espanol" or whatever... or have another entry on the .ws file like language_path=.\... and then have the language\pkg files copy into the workspace instead. Or maybe just have the language_current.inc reside in the workspace, not on the global pkg.


Thank you,
Oscar Mintegui

Vincent Oorsprong
25-Apr-2017, 12:44 AM
Oscar,

The good news is that you don't have to copy the files. Do the following:

- Change the AppSrcPath setting in the workspace to include the Spanish folder of the DataFlex installation. The default AppSrcPath is '.\AppSrc' so change this to '.\AppSrc;c:\program files (x86)\DataFlex 19.0\\Usr\Language\Espanol\Pkg'
- Create a file called header.pkg with the following contents:


Use Ui
Use DfAllent.pkg

- Precompile this header.pkg
- Replace "Use DfAllent.pkg" in your <application>.src with "Use Header.pkg"
- Compile your application and all translated constants are now in Spanish

Open another workspace to see this is all in English

Alternative of this is not static compile translation but use the technique we use in DataFlex Reports dynamic translation. It requires more work and we can't offer it for free but it allows you to offer your application in multiple languages.

Oscar
27-Apr-2017, 09:16 AM
Vincent,

Thank you! I've been working on a translation package for the webapps using a sql table... I do have one for windows apps already in which I use sqlite, since I need to access translation before the workspace is open; I didn't wanted to use them on this project... but I guess it will be best.

Regards,
Oscar Mintegui