Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003199 [JEDI VCL] 00 JVCL Components feature N/A 2005-09-16 07:04 2006-04-14 04:20
Reporter boerema1 View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.00
Summary 0003199: JvgLanguageLoader additions
Description As 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.
Additional Information
Tags No tags attached.
Attached Files zip file icon JvgLanguageLoader.zip [^] (5,977 bytes) 2005-09-16 07:04
zip file icon LanguageLoaderExample.zip [^] (4,019 bytes) 2006-04-08 09:16

- Relationships

-  Notes
(0008837)
obones (administrator)
2006-04-03 05:56

If you have time, yes, I would appreciate a demo application.
(0008840)
jfudickar (developer)
2006-04-03 06:51

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

Greetings
Jens
(0008848)
obones (administrator)
2006-04-03 13:06

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.
(0009040)
boerema1 (reporter)
2006-04-08 09:16

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.
(0009105)
obones (administrator)
2006-04-14 04:20

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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker