File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
tools/cldr-code/src/main/java/org/unicode/cldr/util Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -3338,4 +3338,36 @@ String getStringValueWithBaileyNotConstructed(String path) {
3338
3338
}
3339
3339
return value ;
3340
3340
}
3341
+
3342
+ // The following deprecated constants and methods are implemented only for backward
3343
+ // compatibility with https://github.com/unicode-org/unicodetools
3344
+
3345
+ @ Deprecated public static final int LANGUAGE_NAME = 0 , SCRIPT_NAME = 1 , TERRITORY_NAME = 2 ;
3346
+
3347
+ @ Deprecated
3348
+ public String getName (int type , String code ) {
3349
+ switch (type ) {
3350
+ case LANGUAGE_NAME :
3351
+ return nameGetter .getNameFromTypeEnumCode (NameType .LANGUAGE , code );
3352
+ case SCRIPT_NAME :
3353
+ return nameGetter .getNameFromTypeEnumCode (NameType .SCRIPT , code );
3354
+ case TERRITORY_NAME :
3355
+ return nameGetter .getNameFromTypeEnumCode (NameType .TERRITORY , code );
3356
+ default :
3357
+ throw new IllegalArgumentException ("Unrecognized type" );
3358
+ }
3359
+ }
3360
+
3361
+ @ Deprecated
3362
+ public String getName (String code ) {
3363
+ return nameGetter .getNameFromIdentifier (code );
3364
+ }
3365
+
3366
+ @ Deprecated
3367
+ public String getName (String type , String code ) {
3368
+ if (!type .equals ("territory" )) {
3369
+ throw new IllegalArgumentException ("First argument should be territory" );
3370
+ }
3371
+ return nameGetter .getNameFromTypeEnumCode (NameType .TERRITORY , code );
3372
+ }
3341
3373
}
You can’t perform that action at this time.
0 commit comments