• Welcome to Jose's Read Only Forum 2023.
 

Afx National Language Support

Started by James C. Fuller, March 27, 2017, 09:07:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

James C. Fuller


I've been retesting code with my latest TCLib and VS Community 2017 so I thought I'd post some of the code.
James


'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
'Afx National Language Support
'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
$NOMAIN
$CPP
$ONEXIT "ULEX.EXE $FILE$.CPP TCHARXLATER_VC.TXT"
$ONEXIT "TCLIB.BAT $FILE$"
'==============================================================================
$USE USE_AfxGetLocaleAbbrevDayName USE_AfxGetLocaleAbbrevMonthName USE_AfxGetLocaleCurrencySymbol
$USE USE_AfxGetLocaleDayName USE_AfxGetLocaleDecimalSeparator USE_AfxGetLocaleDigitsGrouping
$USE USE_AfxGetLocaleEnglishCountryName USE_AfxGetLocaleEnglishCurrencyName USE_AfxGetLocaleEnglishDisplayName
$USE USE_AfxGetLocaleEnglishLanguageName USE_AfxGetLocaleInternationalMonetarySymbol
$USE USE_AfxGetLocaleISO639LanguageName USE_AfxGetLocaleISO639LanguageName2 USE_AfxGetLocaleISO3166CountryName
$USE USE_AfxGetLocaleISO3166CountryName2 USE_AfxGetLocaleListItemsSeparator USE_AfxGetLocaleLongDateFormatString
$USE USE_AfxGetLocaleMonetaryDecimalSeparator USE_AfxGetLocaleMonetaryGrouping USE_AfxGetLocaleMonetaryThousandsSeparator
$USE USE_AfxGetLocaleMonthDayFormatString USE_AfxGetLocaleMonthName USE_AfxGetLocaleName
$USE USE_AfxGetLocaleNanString USE_AfxGetLocaleNativeCountryName USE_AfxGetLocaleNativeCurrencyName
$USE USE_AfxGetLocaleNativeDigits USE_AfxGetLocaleNativeDisplayName USE_AfxGetLocaleNativeLanguageName
$USE USE_AfxGetLocaleNegativeInfinityString USE_AfxGetLocaleNegativeSign USE_AfxGetLocaleOpenTypeLanguageTag
$USE USE_AfxGetLocalePermilleSymbol USE_AfxGetLocalePositiveInfinityString USE_AfxGetLocalePositiveSign
$USE USE_AfxGetLocaleScriptsList USE_AfxGetLocaleShortDateFormatString USE_AfxGetLocaleShortestDayName
$USE USE_AfxGetLocaleShortTimeFormatString USE_AfxGetLocaleSortName USE_AfxGetLocaleThousandsSeparator
$USE USE_AfxGetLocaleDateSeparator USE_AfxGetLocaleTimeFormatString USE_AfxGetLocaleTimeSeparator
$USE USE_AfxGetLocaleYearMonthFormatString USE_AfxGetLocalizedCountryName USE_AfxGetLocalizedDisplayName
$USE USE_AfxGetLocalizedLanguageName USE_AfxGetSortLocale
$Include <Afx/AfxNls.bi>
'==============================================================================
Function main()
    Dim s$
    ? "AfxGetLocaleAbbrevDayName(1)                 -> ";AfxGetLocaleAbbrevDayName$(1)
    ? "AfxGetLocaleAbbrevMonthName(9)               -> ";AfxGetLocaleAbbrevMonthName$(9)
    ? "AfxGetLocaleCurrencySymbol()                 -> ";AfxGetLocaleCurrencySymbol$()
    ? "AfxGetLocaleDayName(1)                       -> ";AfxGetLocaleDayName$(1)
    ? "AfxGetLocaleDecimalSeparator()               -> ";AfxGetLocaleDecimalSeparator$()
    ? "AfxGetLocaleDigitsGrouping()                 -> ";AfxGetLocaleDigitsGrouping$()
    ? "AfxGetLocaleEnglishCountryName()             -> ";AfxGetLocaleEnglishCountryName$()
    ? "AfxGetLocaleEnglishCurrencyName()            -> ";AfxGetLocaleEnglishCurrencyName$()             
    ? "AfxGetLocaleEnglishDisplayName()             -> ";AfxGetLocaleEnglishDisplayName$()
    ? "AfxGetLocaleEnglishLanguageName()            -> ";AfxGetLocaleEnglishLanguageName$()
    ? "AfxGetLocaleInternationalMonetarySymbol()    -> ";AfxGetLocaleInternationalMonetarySymbol$()
    ? "AfxGetLocaleISO639LanguageName()             -> ";AfxGetLocaleISO639LanguageName$()
    ? "AfxGetLocaleISO639LanguageName2()            -> ";AfxGetLocaleISO639LanguageName2$()
    ? "AfxGetLocaleISO3166CountryName()             -> ";AfxGetLocaleISO3166CountryName$()
    ? "AfxGetLocaleISO3166CountryName2()            -> ";AfxGetLocaleISO3166CountryName2$()
    ? "AfxGetLocaleListItemsSeparator()             -> ";AfxGetLocaleListItemsSeparator$()
    ? "AfxGetLocaleLongDateFormatString()           -> ";AfxGetLocaleLongDateFormatString$()
    ? "AfxGetLocaleMonetaryDecimalSeparator()       -> ";AfxGetLocaleMonetaryDecimalSeparator$()
    ? "AfxGetLocaleMonetaryGrouping()               -> ";AfxGetLocaleMonetaryGrouping$()
    ? "AfxGetLocaleMonetaryThousandsSeparator()     -> ";AfxGetLocaleMonetaryThousandsSeparator$()
    ? "AfxGetLocaleMonthDayFormatString()           -> ";AfxGetLocaleMonthDayFormatString$()
    ? "AfxGetLocaleMonthName(9)                     -> ";AfxGetLocaleMonthName$(9)
    ? "AfxGetLocaleName()                           -> ";AfxGetLocaleName$()
    ? "AfxGetLocaleNanString()                      -> ";AfxGetLocaleNanString$()
    ? "AfxGetLocaleNativeCountryName()              -> ";AfxGetLocaleNativeCountryName$()
    ? "AfxGetLocaleNativeCurrencyName()             -> ";AfxGetLocaleNativeCurrencyName$()
    ? "AfxGetLocaleNativeDigits()                   -> ";AfxGetLocaleNativeDigits$()
    ? "AfxGetLocaleNativeDisplayName()              -> ";AfxGetLocaleNativeDisplayName$()
    ? "AfxGetLocaleNativeLanguageName()             -> ";AfxGetLocaleNativeLanguageName$()
    ? "AfxGetLocaleNegativeInfinityString()         -> ";AfxGetLocaleNegativeInfinityString$()
    ? "AfxGetLocaleNegativeSign()                   -> ";AfxGetLocaleNegativeSign$()
    ? "AfxGetLocaleOpenTypeLanguageTag()            -> ";AfxGetLocaleOpenTypeLanguageTag$()
    'this will not print to the console but it will show in a MessageBox
    ? "AfxGetLocalePermilleSymbol()                 -> ";"No console display"
    's$ = AfxGetLocalePermilleSymbol()
    'MsgBox s$,"AfxGetLocalePermilleSymbol",MB_OK
    'this will not print to the console but it will show in a MessageBox
    ? "AfxGetLocalePositiveInfinityString()         -> ";"No console display"
    's$ = AfxGetLocalePositiveInfinityString()
    'MsgBox s$,"AfxGetLocalePositiveInfinityString",MB_OK
   
    'the following does not  return a "+" as the ms documentation indicates
    ? "AfxGetLocalePositiveSign()                   -> ";AfxGetLocalePositiveSign$()
    ? "AfxGetLocaleScriptsList()                    -> ";AfxGetLocaleScriptsList$()
    ? "AfxGetLocaleShortDateFormatString()          -> ";AfxGetLocaleShortDateFormatString$()
    ? "AfxGetLocaleShortestDayName(6)               -> ";AfxGetLocaleShortestDayName$(6)
    ? "AfxGetLocaleShortTimeFormatString()          -> ";AfxGetLocaleShortTimeFormatString$()
    ? "AfxGetLocaleSortName()                       -> ";AfxGetLocaleSortName$()
    ? "AfxGetLocaleThousandsSeparator()             -> ";AfxGetLocaleThousandsSeparator$() 
    ? "AfxGetLocaleDateSeparator()                  -> ";AfxGetLocaleDateSeparator$()
    ? "AfxGetLocaleTimeFormatString()               -> ";AfxGetLocaleTimeFormatString$()
    ? "AfxGetLocaleTimeSeparator()                  -> ";AfxGetLocaleTimeSeparator$()
    ? "AfxGetLocaleYearMonthFormatString()          -> ";AfxGetLocaleYearMonthFormatString$()
    ? "AfxGetLocalizedCountryName()                 -> ";AfxGetLocalizedCountryName$()
    ? "AfxGetLocalizedDisplayName()                 -> ";AfxGetLocalizedDisplayName$()
    ? "AfxGetLocalizedLanguageName()                -> ";AfxGetLocalizedLanguageName$()
    ? "AfxGetSortLocale()                           -> ";AfxGetSortLocale$()

    Pause
   
End Function




James C. Fuller

The results from above:

AfxGetLocaleAbbrevDayName(1)                -> Mon
AfxGetLocaleAbbrevMonthName(9)              -> Sep
AfxGetLocaleCurrencySymbol()                -> $
AfxGetLocaleDayName(1)                      -> Monday
AfxGetLocaleDecimalSeparator()              -> .
AfxGetLocaleDigitsGrouping()                -> 3;0
AfxGetLocaleEnglishCountryName()            -> United States
AfxGetLocaleEnglishCurrencyName()           -> US Dollar
AfxGetLocaleEnglishDisplayName()            -> English (United States)
AfxGetLocaleEnglishLanguageName()           -> English
AfxGetLocaleInternationalMonetarySymbol()   -> USD
AfxGetLocaleISO639LanguageName()            -> en
AfxGetLocaleISO639LanguageName2()           -> eng
AfxGetLocaleISO3166CountryName()            -> US
AfxGetLocaleISO3166CountryName2()           -> USA
AfxGetLocaleListItemsSeparator()            -> ,
AfxGetLocaleLongDateFormatString()          -> dddd, MMMM d, yyyy
AfxGetLocaleMonetaryDecimalSeparator()      -> .
AfxGetLocaleMonetaryGrouping()              -> 3;0
AfxGetLocaleMonetaryThousandsSeparator()    -> ,
AfxGetLocaleMonthDayFormatString()          -> MMMM d
AfxGetLocaleMonthName(9)                    -> September
AfxGetLocaleName()                          -> en-US
AfxGetLocaleNanString()                     -> NaN
AfxGetLocaleNativeCountryName()             -> United States
AfxGetLocaleNativeCurrencyName()            -> US Dollar
AfxGetLocaleNativeDigits()                  -> 0123456789
AfxGetLocaleNativeDisplayName()             -> English (United States)
AfxGetLocaleNativeLanguageName()            -> English
AfxGetLocaleNegativeInfinityString()        -> -
AfxGetLocaleNegativeSign()                  -> -
AfxGetLocaleOpenTypeLanguageTag()           -> ENG
AfxGetLocalePermilleSymbol()                -> No console display
AfxGetLocalePositiveInfinityString()        -> No console display
AfxGetLocalePositiveSign()                  ->
AfxGetLocaleScriptsList()                   -> Latn;
AfxGetLocaleShortDateFormatString()         -> M/d/yyyy
AfxGetLocaleShortestDayName(6)              -> Sa
AfxGetLocaleShortTimeFormatString()         -> h:mm tt
AfxGetLocaleSortName()                      -> Default
AfxGetLocaleThousandsSeparator()            -> ,
AfxGetLocaleDateSeparator()                 -> /
AfxGetLocaleTimeFormatString()              -> h:mm:ss tt
AfxGetLocaleTimeSeparator()                 -> :
AfxGetLocaleYearMonthFormatString()         -> MMMM yyyy
AfxGetLocalizedCountryName()                -> United States
AfxGetLocalizedDisplayName()                -> English (United States)
AfxGetLocalizedLanguageName()               -> English (United States)
AfxGetSortLocale()                          -> en-US