public String getI18nPropertiesString ( ) throws IOException { // Load all properties Properties i18nProps = new Properties ( ) ; // add entries for ( Entry < String , String > entry : properties . entrySet ( ) ) { String key = entry . getKey ( ) ; String escapedKey = validName ( key ) ; i18nProps . put ( escapedKey , entry . getValue ( ) ) ; } try ( ByteArrayOutputStream outStream = new ByteArrayOutputStream ( ) ) { i18nProps . store ( outStream , null ) ; // Property files are always ISO 8859 encoded return outStream . toString ( CharEncoding . ISO_8859_1 ) ; } }
Build i18n resource PROPERTIES .