View Issue Details

IDProjectCategoryView StatusLast Update
0003199JEDI VCL00 JVCL Componentspublic2006-04-14 04:20
Reporterboerema1Assigned Toobones 
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Product Version3.00 
Target VersionFixed in Version3.30 
Summary0003199: JvgLanguageLoader additions
DescriptionAs per request in the newsgroup here's my version of JvgLanguageLoader.
If you want I can make an example but I do not have much time at the moment.

Changes and additions in my version:
* uses TIniFile to load translations. Every form has a section and string constants have a separate section.
- lofTrimSpaces doesn't work because TIniFile alsways trims

Added properties:
+ DictionaryFileName: stores filename with translations
+ FormSection: section name in translations file of form to translate
+ StringsSection: section name of string constants
+ IgnoreList: contains items to ignore when translating

String constant translations are kept in a seperate stringlist and can be used whenever a constant needs to be translated, using function Translate(const Text: string): string;

To translate a form use
procedure TranslateComponent(Component: TComponent; DoLoadStrings: Boolean);
If DoLoadStrings is true the string constants are also loaded

To change translations:
procedure ChangeTranslation(Component: TComponent; DoLoadStrings: Boolean; OldLanguageFileName: string);
Where OldLanguageFileName should contain the current file with the current translation and property DictionaryFileName should contain the new translation file.
TagsNo tags attached.

Activities

2005-09-16 07:04

 

JvgLanguageLoader.zip (5,977 bytes)

obones

2006-04-03 05:56

administrator   ~0008837

If you have time, yes, I would appreciate a demo application.

jfudickar

2006-04-03 06:51

developer   ~0008840

I would propably suggest to use the JvAppStorage for the definitions. It's much more flexible then the inifile.

Greetings
Jens

obones

2006-04-03 13:06

administrator   ~0008848

It would be better indeed, but as this is a Globus component, its life in the JVCL may not be too long anymore. I'm not saying it will disappear, but it will be deprecated at some point in time. See the roadmap for details.

boerema1

2006-04-08 09:16

reporter   ~0009040

Here's the example as requested. Nothing fancy but it shows how it works.
Note: the program expects to find the language files in the same directory as the exe.

2006-04-08 09:16

 

LanguageLoaderExample.zip (4,019 bytes)

obones

2006-04-14 04:20

administrator   ~0009105

This is now all in CVS.
But please, should you submit code in the future, please respect the STYLE GUIDE. It is very annoying to clean up the source code.

Issue History

Date Modified Username Field Change
2005-09-16 07:04 boerema1 New Issue
2005-09-16 07:04 boerema1 File Added: JvgLanguageLoader.zip
2006-04-03 05:56 obones Note Added: 0008837
2006-04-03 05:56 obones Status new => feedback
2006-04-03 06:51 jfudickar Note Added: 0008840
2006-04-03 13:06 obones Note Added: 0008848
2006-04-08 09:16 boerema1 Note Added: 0009040
2006-04-08 09:16 boerema1 File Added: LanguageLoaderExample.zip
2006-04-12 01:09 obones Status feedback => acknowledged
2006-04-14 04:20 obones Status acknowledged => resolved
2006-04-14 04:20 obones Resolution open => fixed
2006-04-14 04:20 obones Assigned To => obones
2006-04-14 04:20 obones Note Added: 0009105