Locale library

corwin42

Expert
Licensed User
Longtime User
Locale library is a library which will help you making your programs work in many languages.

You can get information about the current culture of your device or desktop PC like specific calendar properties, date formats, number formats, currency symbol and much more.

The most powerful object is the Translator object. You can make your applications run in many languages very easy.

Currently there are four object types in this library.

The CultureInfo object provides much information about a culture setting.
The DateTime object has powerful formatting functions for dates and times.
The Numeric object has formatting functions for numbers.
The Translator objects helps you making your applications available in many languages.

History:
  • V1.0: initial release
  • V1.1 : New Numeric object, Sep"a"rator typo fixed, Parse() in DateTime object (See post #5 for more info)
  • V1.2 : New Translator object (See post #6 for more info)
 

Attachments

  • Locale1_2.zip
    36.1 KB · Views: 156
Last edited:

mjcoon

Well-Known Member
Licensed User
This is an excellent idea and long overdue (even though I don't expect to need it myself!).

I've only read the Help .chm file. Did you really spell DateSeperator, NumberGroupSeperator, TimeSeperator and NumberDecimalSeperator with an "e" rather than as DateSeparator, NumberGroupSeparator, TimeSeparator and NumberDecimalSeparator? (In the tabulation for the DateTime object the spelling of separator is correct.)

Mike.
 

corwin42

Expert
Licensed User
Longtime User
I've only read the Help .chm file. Did you really spell DateSeperator, NumberGroupSeperator, TimeSeperator and NumberDecimalSeperator with an "e" rather than as DateSeparator,

Ooops. Yes seems that I have spelled it wrong. Will be fixed in the next update. Thanks for reporting.
 

corwin42

Expert
Licensed User
Longtime User
New version 1.1 released:

- Spep"a"rator typo fixed. Attention: This version is incompatible to V1.0!
- New Parse() method for parsing DateTime Strings and convert them into ticks.
- New Numeric object with number formatting functions.

See post #1.
 

corwin42

Expert
Licensed User
Longtime User
New version 1.2 released:

This version has a new Translator object. With this you can add multilanguage support for your applications very easy.

Just add a Translator object and initialize it. Access all your strings in your program through the Translator.GetText() Method and provide a translation file (simple text file) for every language you want to support. Thats it.

See the example program how it is done. The example program works in english (default language), german, french and italian language. You can easily write a language template file for any other language from within the program. Just translate the strings in the template to the new language and you are done.

Many thanks goes to Filippo and Klaus for providing the italian and french language files.

Have fun with it and I hope it will be of any value.
 
Top