< prev index next >

src/java.base/share/classes/sun/util/locale/provider/LocaleNameProviderImpl.java

Print this page
rev 47733 : 8176841: Additional Unicode Language-Tag Extensions
8189134: New system properties for the default Locale extensions
Reviewed-by:

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -166,10 +166,30 @@
     @Override
     public String getDisplayVariant(String vrnt, Locale locale) {
         return getDisplayString("%%"+vrnt, locale);
     }
 
+    /**
+     * @inheritDoc
+     */
+    @Override
+    public String getDisplayUnicodeExtensionKey(String key, Locale locale) {
+        String rbKey = "key." + key;
+        String name = getDisplayString(rbKey, locale);
+        return rbKey.equals(name) ? key : name;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override
+    public String getDisplayUnicodeExtensionType(String extType, String key, Locale locale) {
+        String rbKey = "type." + key + "." + extType;
+        String name = getDisplayString(rbKey, locale);
+        return rbKey.equals(name) ? extType : name;
+    }
+
     private String getDisplayString(String key, Locale locale) {
         if (key == null || locale == null) {
             throw new NullPointerException();
         }
 
< prev index next >