Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can define two property-files. One for English and one for Turkish.<br/>The Enum could then look like this:</p> <pre><code>public static enum API_ENDPOINT{ MISSION("path.to.property.mission"), FEATURED_MEDIA("path.to.property.featured_media"); private String propertyName; API_ENDPOINT(String propertyName){ this.propertyName = propertyName; } // language could also be an enum which defines the language to be taken // and should contain the path to the file. public String getTranslatedText(Language language){ Properties prop = new Properties(); try { //load a properties file from class path prop.load(API_ENDPOINT.class.getClassLoader().getResourceAsStream(language.getPropertyFileName())); //get the translated value and raturn it. return prop.getProperty(propertyName); } catch (IOException ex) { ex.printStackTrace(); } } } </code></pre> <p>The Property-File will look like this (<em>English</em>):</p> <pre><code>path.to.property.mission=Mission path.to.property.featured_media=Featured Media </code></pre> <p>Same goes for Turkish. Hope that helps.</p> <p>EDIT: Due to you are using Android, this might be the solution for your problem:</p> <ul> <li><p><a href="https://stackoverflow.com/questions/6350193/is-there-a-sensible-way-to-refer-to-application-resources-r-string-in-stati/6350364#6350364">Is there a sensible way to refer to application resources (R.string...) in static initializers</a></p></li> <li><p><a href="https://stackoverflow.com/questions/17167144/make-enum-tostring-localized">Make Enum.toString() localized</a></p></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload