Announcement

Collapse

Forum Guidelines

This forum is for finished source code that is working properly. If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
See more
See less

List of LCIDs and Date Formats

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • List of LCIDs and Date Formats

    Displays Datestring and DateStringLong formats produced by PowerTime when invoked with LCID parameter. List of LCIDs from here: https://www.science.co.il/language/Locale-codes.php

    Click image for larger version

Name:	LCIDDates.jpg
Views:	90
Size:	46.8 KB
ID:	797969


    '
    Code:
    #COMPILE EXE "LCIDDates.exe"
    #DIM ALL
    %UNICODE = 1
    #INCLUDE ONCE "WIN32API.INC" 'Roca includes
    
    %IDD_DIALOG1   =  101
    %IDC_btnClose  = 1001
    %IDC_LISTVIEW1 = 1002
    
    GLOBAL LCIDs() AS WSTRING
    FUNCTION PBMAIN () AS LONG
       InitLCIDs
        ShowDIALOG1 %HWND_DESKTOP
    END FUNCTION
    
    FUNCTION InitLCIDs() AS LONG
    LOCAL lngItems,x AS LONG
    LOCAL ip AS IPOWERTIME
    IP = CLASS "POWERTIME"
    ip.newdate 2020,12,31
    lngItems= DATACOUNT /2
    REDIM LCIDs(0 TO 3,0 TO lngItems - 1)
    FOR x = 0 TO lngItems - 1
    LCIDs(0,x) = READ$(x*2 + 1)
    LCIDs(1,x) = READ$(x*2 + 2)
    LCIDs(2,x) = ip.datestring(VAL(LCIDs(1,x)))
    LCIDs(3,x) = ip.datestringlong(VAL(LCIDs(1,x)))
    NEXT
    
    DATA Afrikaans,1078
    DATA Albanian,1052
    DATA Amharic,1118
    DATA Arabic - Algeria,5121
    DATA Arabic - Bahrain,15361
    DATA Arabic - Egypt,3073
    DATA Arabic - Iraq,2049
    DATA Arabic - Jordan,11265
    DATA Arabic - Kuwait,13313
    DATA Arabic - Lebanon,12289
    DATA Arabic - Libya,4097
    DATA Arabic - Morocco,6145
    DATA Arabic - Oman,8193
    DATA Arabic - Qatar,16385
    DATA Arabic - Saudi Arabia,1025
    DATA Arabic - Syria,10241
    DATA Arabic - Tunisia,7169
    DATA Arabic - United Arab Emirates,14337
    DATA Arabic - Yemen,9217
    DATA Armenian,1067
    DATA Assamese,1101
    DATA Azeri - Cyrillic,2092
    DATA Azeri - Latin,1068
    DATA Basque,1069
    DATA Belarusian,1059
    DATA Bengali - Bangladesh,2117
    DATA Bengali - India,1093
    DATA Bosnian,5146
    DATA Bulgarian,1026
    DATA Burmese,1109
    DATA Catalan,1027
    DATA Chinese - China,2052
    DATA Chinese - Hong Kong SAR,3076
    DATA Chinese - Macau SAR,5124
    DATA Chinese - Singapore,4100
    DATA Chinese - Taiwan,1028
    DATA Croatian,1050
    DATA Czech,1029
    DATA Danish,1030
    DATA Divehi,dv
    DATA Dutch - Belgium,2067
    DATA Dutch - Netherlands,1043
    DATA Edo,1126
    DATA English - Australia,3081
    DATA English - Belize,10249
    DATA English - Canada,4105
    DATA English - Caribbean,9225
    DATA English - Great Britain,2057
    DATA English - India,16393
    DATA English - Ireland,6153
    DATA English - Jamaica,8201
    DATA English - New Zealand,5129
    DATA English - Philippines,13321
    DATA English - Southern Africa,7177
    DATA English - Trinidad,11273
    DATA English - United States,1033
    DATA English - Zimbabwe,12297
    DATA Estonian,1061
    DATA FYRO Macedonia,1071
    DATA Faroese,1080
    DATA Farsi - Persian,1065
    DATA Filipino,1124
    DATA Finnish,1035
    DATA French - Belgium,2060
    DATA French - Cameroon,11276
    DATA French - Canada,3084
    DATA French - Congo,9228
    DATA French - Cote d'Ivoire,12300
    DATA French - France,1036
    DATA French - Luxembourg,5132
    DATA French - Mali,13324
    DATA French - Monaco,6156
    DATA French - Morocco,14348
    DATA French - Senegal,10252
    DATA French - Switzerland,4108
    DATA French - West Indies,7180
    DATA Frisian - Netherlands,1122
    DATA Gaelic - Ireland,2108
    DATA Gaelic - Scotland,1084
    DATA Galician,1110
    DATA Georgian,1079
    DATA German - Austria,3079
    DATA German - Germany,1031
    DATA German - Liechtenstein,5127
    DATA German - Luxembourg,4103
    DATA German - Switzerland,2055
    DATA Greek,1032
    DATA Guarani - Paraguay,1140
    DATA Gujarati,1095
    DATA HID (Human Interface Device),1279
    DATA Hebrew,1037
    DATA Hindi,1081
    DATA Hungarian,1038
    DATA Icelandic,1039
    DATA Igbo - Nigeria,1136
    DATA Indonesian,1057
    DATA Italian - Italy,1040
    DATA Italian - Switzerland,2064
    DATA Japanese,1041
    DATA Kannada,1099
    DATA Kashmiri,1120
    DATA Kazakh,1087
    DATA Khmer,1107
    DATA Konkani,1111
    DATA Korean,1042
    DATA Kyrgyz - Cyrillic,1088
    DATA Lao,1108
    DATA Latin,1142
    DATA Latvian,1062
    DATA Lithuanian,1063
    DATA Malay - Brunei,2110
    DATA Malay - Malaysia,1086
    DATA Malayalam,1100
    DATA Maltese,1082
    DATA Manipuri,1112
    DATA Maori,1153
    DATA Marathi,1102
    DATA Mongolian,2128
    DATA Mongolian,1104
    DATA Nepali,1121
    DATA Norwegian - Bokml,1044
    DATA Norwegian - Nynorsk,2068
    DATA Oriya,1096
    DATA Polish,1045
    DATA Portuguese - Brazil,1046
    DATA Portuguese - Portugal,2070
    DATA Punjabi,1094
    DATA Raeto-Romance,1047
    DATA Romanian - Moldova,2072
    DATA Romanian - Romania,1048
    DATA Russian,1049
    DATA Russian - Moldova,2073
    DATA Sami Lappish,1083
    DATA Sanskrit,1103
    DATA Serbian - Cyrillic,3098
    DATA Serbian - Latin,2074
    DATA Sesotho (Sutu),1072
    DATA Setsuana,1074
    DATA Sindhi,1113
    DATA Sinhala,si
    DATA Slovak,1051
    DATA Slovenian,1060
    DATA Somali,1143
    DATA Sorbian,1070
    DATA Spanish - Argentina,11274
    DATA Spanish - Bolivia,16394
    DATA Spanish - Chile,13322
    DATA Spanish - Colombia,9226
    DATA Spanish - Costa Rica,5130
    DATA Spanish - Dominican Republic,7178
    DATA Spanish - Ecuador,12298
    DATA Spanish - El Salvador,17418
    DATA Spanish - Guatemala,4106
    DATA Spanish - Honduras,18442
    DATA Spanish - Mexico,2058
    DATA Spanish - Nicaragua,19466
    DATA Spanish - Panama,6154
    DATA Spanish - Paraguay,15370
    DATA Spanish - Peru,10250
    DATA Spanish - Puerto Rico,20490
    DATA Spanish - Spain (Traditional),1034
    DATA Spanish - Uruguay,14346
    DATA Spanish - Venezuela,8202
    DATA Swahili,1089
    DATA Swedish - Finland,2077
    DATA Swedish - Sweden,1053
    DATA Syriac,1114
    DATA Tajik,1064
    DATA Tamil,1097
    DATA Tatar,1092
    DATA Telugu,1098
    DATA Thai,1054
    DATA Tibetan,1105
    DATA Tsonga,1073
    DATA Turkish,1055
    DATA Turkmen,1090
    DATA Ukrainian,1058
    DATA Unicode,0
    DATA Urdu,1056
    DATA Uzbek - Cyrillic,2115
    DATA Uzbek - Latin,1091
    DATA Venda,1075
    DATA Vietnamese,1066
    DATA Welsh,1106
    DATA Xhosa,1076
    DATA Yiddish,1085
    DATA Zulu,1077
    END FUNCTION
    
    CALLBACK FUNCTION ShowDIALOG1Proc()
        SELECT CASE AS LONG CB.MSG
             CASE %WM_COMMAND
                SELECT CASE AS LONG CB.CTL
                    CASE %IDC_btnClose
                        IF CB.CTLMSG = %BN_CLICKED OR CB.CTLMSG = 1 THEN
                            DIALOG END CB.HNDL
                        END IF
                END SELECT
        END SELECT
    END FUNCTION
    
    FUNCTION FillList(hDlg AS DWORD,lID AS LONG) AS LONG
        LOCAL x   AS LONG
        LOCAL lStyle AS LONG
    
        LISTVIEW GET STYLEXX hDlg, lID TO lStyle
        LISTVIEW SET STYLEXX hDlg, lID, lStyle OR %LVS_EX_FULLROWSELECT OR _
            %LVS_EX_GRIDLINES
    
       LISTVIEW INSERT COLUMN hDlg, lID, 1, "Locale", 0, 0
       LISTVIEW INSERT COLUMN hDlg, lID, 2, "LCID", 0, 0
       LISTVIEW INSERT COLUMN hDlg, lID, 3, "Date Short", 0, 0
       LISTVIEW INSERT COLUMN hDlg, lID, 4, "Date Long", 0, 0
    
    
        ' Load sample data.
        FOR x = 1 TO UBOUND(LCIDS(2))+1
            LISTVIEW INSERT ITEM hDlg, lID, x, 0, LCIDs(0,x-1)
            LISTVIEW SET TEXT hDlg, lID, x, 2, LCIDs(1,x-1)
            LISTVIEW SET TEXT hDlg, lID, x, 3, LCIDs(2,x-1)
            LISTVIEW SET TEXT hDlg, lID, x, 4, LCIDs(3,x-1)
        NEXT
    
        ' Auto size columns.
        FOR x = 1 TO 4
            LISTVIEW FIT HEADER hDlg, lID, x
        NEXT
    END FUNCTION
    
    FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
        LOCAL lRslt AS LONG
        LOCAL hDlg  AS DWORD
        LOCAL hFont AS DWORD
        FONT NEW "Arial Unicode",10 TO hFont
    
        DIALOG NEW hParent, "LCID Date formats", 191, 59, 600, 400, %WS_POPUP OR _
            %WS_BORDER OR %WS_DLGFRAME OR %WS_CAPTION OR %WS_SYSMENU OR _
            %WS_MINIMIZEBOX OR %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME _
            OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, _
            %WS_EX_CONTROLPARENT OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
            %WS_EX_RIGHTSCROLLBAR, TO hDlg
        CONTROL ADD BUTTON,   hDlg, %IDC_btnClose, "Close", 450, 300, 95, 30
        CONTROL ADD LISTVIEW, hDlg, %IDC_LISTVIEW1, "Listview1", 25, 15, 400, 350
        CONTROL SET FONT hDlg,%IDC_LISTVIEW1, hFont
        FillList hDlg,%IDC_LISTVIEW1
        DIALOG SHOW MODAL hDlg, CALL ShowDIALOG1Proc TO lRslt
        FUNCTION = lRslt
    END FUNCTION
     '
Working...
X