Locale

( )
2 Votes

The Locale-module is a must have for all who works with projects that must handle different language locales at once, without being bound by the computers locale-setting. In this module you will find functions to convert different datatypes back and forth to strings as well as functions to validate strings against different datatypes.

Download Donate License

Be the first to leve a comment or ask a question about the code!

Here is an example how to use it:

The interface:

  • FormatLocaleDateTime(ByVal LCID As Long, ByVal Expression As Date) As String
    Converts a date-variable to a string containing the date and time in the given locale.
  • FormatLocaleDate(ByVal LCID As Long, ByVal Expression As Date) As String
     Converts a date-variable to a string containing only the date in the given locale.
  • FormatLocaleTime(ByVal LCID As Long, ByVal Expression As Date) As String
    Converts a date-variable to a string containing the time in the given locale.
  • FormatLocaleLong(ByVal LCID As Long, ByVal Expression As Long) As String
    Converts a long-variable to a string in the given locale.
  • FormatLocaleDouble(ByVal LCID As Long, ByVal Expression As Double, Optional ByVal NumDigits As Long = 2) As String
    Converts a double-variable to a string in the given locale.
  • FormatLocaleCurrency(ByVal LCID As Long, ByVal Expression As Currency, Optional ByVal NumDigits As Long = 2) As String
    Converts a currency-variable to a string in the given locale.
  • FormatLocaleBoolean(ByVal LCID As Long, ByVal Expression As Boolean) As String
    Converts a boolean-variable to a string in the given locale.
  • GetLocaleInformation(ByVal LCID As Long, ByVal LCType As LocaleInfoEnum) As String
    Retrives information about a locale. 
  • GetDLLErrorDescription(ByVal ErrorNo As Long, ByVal LCID As Long) As String
    Gets the DLL error message for a given error in the given locale.
    Use this to show system error-messages in any language.
  • ParseLocaleBoolean(ByVal LCID As Long, ByVal Expression As String) As Boolean
    Parses a string in the given locale to a boolean-variable.
  • IsLocaleBoolean(ByVal LCID As Long, ByVal Expression As String) As Boolean
    Tests a string to see if it's a valid boolean-value in the given locale.
  • ParseLocaleCurrency(ByVal LCID As Long, ByVal Expression As String) As Currency
    Parses a string in the given locale to a Currency-variable.
  • IsLocaleCurrency(ByVal LCID As Long, ByVal Expression As String) As Boolean
    Tests a string to see if it's a valid currency-value in the given locale.
  • ParseLocaleDate(ByVal LCID As Long, ByVal Expression As String) As Date
    Parses a string in the given locale to a date-variable.
  • IsLocaleDate(ByVal LCID As Long, ByVal Expression As String) As Boolean
    Tests a string to see if it's a valid date-value in the given locale.
  • ParseLocaleDouble(ByVal LCID As Long, ByVal Expression As String) As Double
    Parses a string in the given locale to a double-variable.
  • IsLocaleDouble(ByVal LCID As Long, ByVal Expression As String) As Boolean
    Tests a string to see if it's a valid double-value in the given locale.
  • GetFloatRegEx(ByVal LCID As Long) As String
    Returns a string containing a regex expression to validate if a string is a valid float-value in the given locale.
  • GetIntegerRegEx(ByVal LCID As Long) As String
    Returns a string containing a regex expression to validate if a string is a valid integer-value in the given locale.
  • GetJScriptParseLocaleDouble(ByVal LCID As Long)
    Returns a string containing jscript to parse a string in the given locale to a double-variable. 
  • MakeLanguageID(ByVal usPrimaryLanguage As Long, usSubLanguage As Long) As Long
    Creates a LanguageID.
  • MakeLCID(ByVal wLanguageID As Long, ByVal wSortID As Long)
    Creates a LCID (Locale ID). 

Do you want your organization to take off
or are you happy as long as it doesn't drop?
With participation and motivated staff you organization can get airborne!

Last update Tuesday, August 07, 2007
Copyright © 2006 Datomatic. All rights reserved

Powered by umbraco