How to make the Chinese language environment display in Chinese as a special simplification or tradition
                                        
                    •
                    Java                                    
                I'm using Java util. Locale generates a list of locales and prints out their local display language (that is, print out ja_jp as Japanese) I noticed zh_ CN (Simplified Chinese) and zh_ Tw (traditional Chinese) is localized to Chinese instead of simplified and traditional Chinese Is there a way for these locales to include simplified and traditional prefix characters without hard coding zh_ Cn should be simplified Chinese and zh_ Tw should be traditional Chinese? I know I can print the language country (i.e. Chinese), but it's not exactly the same
This is a Java fragment that proves that they are the same:
import java.util.Locale;
public final class test {
  public static void main(String[] args) {
    Locale locale1 = new Locale("zh","cn");
    System.out.println( locale1.getDisplayLanguage(locale1));
    System.out.println( locale1.getDisplayLanguage(Locale.TradITIONAL_CHINESE));
    System.out.println( locale1.getDisplayLanguage(Locale.SIMPLIFIED_CHINESE));
    System.out.println( locale1.getDisplayCountry(locale1));
    System.out.println( "");
    Locale locale2 = new Locale("zh","tw");
    System.out.println( locale2.getDisplayLanguage(locale2));
    System.out.println( locale2.getDisplayLanguage(Locale.TradITIONAL_CHINESE));
    System.out.println( locale2.getDisplayLanguage(Locale.SIMPLIFIED_CHINESE));
    System.out.println( locale2.getDisplayCountry(locale2));
  }
}
Solution
Instantiating the locale object in the following way should solve your problem:
Locale locale1 = new Locale("zh","CN");
Locale locale2 = new Locale("zh","TW");
                
                            The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
                        
                                            
                        THE END
                    
                    
                    
                                                        二维码
                        
                        
                                                
                        