6666 from java .time import Instant , ZonedDateTime , ZoneId
6767
6868
69- class classproperty (property ): # pylint: disable=invalid-name
70- def __get__ (self , cls , owner ): # type: ignore[no-untyped-def]
71- return classmethod (self .fget ).__get__ (None , owner )()
72-
73-
7469class Collection (object ):
7570
7671 def add (self , e ):
@@ -1275,118 +1270,36 @@ class Locale(Object):
12751270 language = None # type: str
12761271 variant = None # type: Optional[str]
12771272
1273+ # Class attribute constants
1274+ CANADA = None # type: Locale
1275+ CANADA_FRENCH = None # type: Locale
1276+ CHINA = None # type: Locale
1277+ CHINESE = None # type: Locale
1278+ ENGLISH = None # type: Locale
1279+ FRANCE = None # type: Locale
1280+ FRENCH = None # type: Locale
1281+ GERMAN = None # type: Locale
1282+ GERMANY = None # type: Locale
1283+ ITALIAN = None # type: Locale
1284+ ITALY = None # type: Locale
1285+ JAPAN = None # type: Locale
1286+ JAPANESE = None # type: Locale
1287+ KOREA = None # type: Locale
1288+ KOREAN = None # type: Locale
1289+ PRC = None # type: Locale
1290+ SIMPLIFIED_CHINESE = None # type: Locale
1291+ TAIWAN = None # type: Locale
1292+ TRADITIONAL_CHINESE = None # type: Locale
1293+ UK = None # type: Locale
1294+ US = None # type: Locale
1295+
12781296 def __init__ (self , language , country = None , variant = None ):
12791297 # type: (str, Optional[str], Optional[str]) -> None
12801298 super (Locale , self ).__init__ ()
12811299 self .language = language
12821300 self .country = country
12831301 self .variant = variant
12841302
1285- @classproperty
1286- def CANADA (self ):
1287- # type: () -> Locale
1288- return Locale ("en" , "CA" )
1289-
1290- @classproperty
1291- def CANADA_FRENCH (self ):
1292- # type: () -> Locale
1293- return Locale ("fr" , "CA" )
1294-
1295- @classproperty
1296- def CHINA (self ):
1297- # type: () -> Locale
1298- return Locale ("zh" , "CN" )
1299-
1300- @classproperty
1301- def CHINESE (self ):
1302- # type: () -> Locale
1303- return Locale ("zh" )
1304-
1305- @classproperty
1306- def ENGLISH (self ):
1307- # type: () -> Locale
1308- return Locale ("en" )
1309-
1310- @classproperty
1311- def FRANCE (self ):
1312- # type: () -> Locale
1313- return Locale ("fr" , "FR" )
1314-
1315- @classproperty
1316- def FRENCH (self ):
1317- # type: () -> Locale
1318- return Locale ("fr" )
1319-
1320- @classproperty
1321- def GERMAN (self ):
1322- # type: () -> Locale
1323- return Locale ("de" )
1324-
1325- @classproperty
1326- def GERMANY (self ):
1327- # type: () -> Locale
1328- return Locale ("de" , "DE" )
1329-
1330- @classproperty
1331- def ITALIAN (self ):
1332- # type: () -> Locale
1333- return Locale ("it" )
1334-
1335- @classproperty
1336- def ITALY (self ):
1337- # type: () -> Locale
1338- return Locale ("it" , "IT" )
1339-
1340- @classproperty
1341- def JAPAN (self ):
1342- # type: () -> Locale
1343- return Locale ("ja" , "JP" )
1344-
1345- @classproperty
1346- def JAPANESE (self ):
1347- # type: () -> Locale
1348- return Locale ("ja" )
1349-
1350- @classproperty
1351- def KOREA (self ):
1352- # type: () -> Locale
1353- return Locale ("ko" , "KR" )
1354-
1355- @classproperty
1356- def KOREAN (self ):
1357- # type: () -> Locale
1358- return Locale ("ko" )
1359-
1360- @classproperty
1361- def PRC (self ):
1362- # type: () -> Locale
1363- return Locale ("zh" , "CN" )
1364-
1365- @classproperty
1366- def SIMPLIFIED_CHINESE (self ):
1367- # type: () -> Locale
1368- return Locale ("zh" , "CN" )
1369-
1370- @classproperty
1371- def TAIWAN (self ):
1372- # type: () -> Locale
1373- return Locale ("zh" , "TW" )
1374-
1375- @classproperty
1376- def TRADITIONAL_CHINESE (self ):
1377- # type: () -> Locale
1378- return Locale ("zh" , "TW" )
1379-
1380- @classproperty
1381- def UK (self ):
1382- # type: () -> Locale
1383- return Locale ("en" , "GB" )
1384-
1385- @classproperty
1386- def US (self ):
1387- # type: () -> Locale
1388- return Locale ("en" , "US" )
1389-
13901303 def __str__ (self ):
13911304 # type: () -> str
13921305 ret = self .language
@@ -1401,6 +1314,29 @@ def __repr__(self):
14011314 return "{!r}" .format (self .__str__ ())
14021315
14031316
1317+ Locale .CANADA = Locale ("en" , "CA" )
1318+ Locale .CANADA_FRENCH = Locale ("fr" , "CA" )
1319+ Locale .CHINA = Locale ("zh" , "CN" )
1320+ Locale .CHINESE = Locale ("zh" )
1321+ Locale .ENGLISH = Locale ("en" )
1322+ Locale .FRANCE = Locale ("fr" , "FR" )
1323+ Locale .FRENCH = Locale ("fr" )
1324+ Locale .GERMAN = Locale ("de" )
1325+ Locale .GERMANY = Locale ("de" , "DE" )
1326+ Locale .ITALIAN = Locale ("it" )
1327+ Locale .ITALY = Locale ("it" , "IT" )
1328+ Locale .JAPAN = Locale ("ja" , "JP" )
1329+ Locale .JAPANESE = Locale ("ja" )
1330+ Locale .KOREA = Locale ("ko" , "KR" )
1331+ Locale .KOREAN = Locale ("ko" )
1332+ Locale .PRC = Locale ("zh" , "CN" )
1333+ Locale .SIMPLIFIED_CHINESE = Locale ("zh" , "CN" )
1334+ Locale .TAIWAN = Locale ("zh" , "TW" )
1335+ Locale .TRADITIONAL_CHINESE = Locale ("zh" , "TW" )
1336+ Locale .UK = Locale ("en" , "GB" )
1337+ Locale .US = Locale ("en" , "US" )
1338+
1339+
14041340class Properties (Hashtable ):
14051341 def __init__ (self , * args ):
14061342 # type: (*Any) -> None
0 commit comments