title: Getting info from .properties file Java
body: <p>I have to write a code which translates numbers into words and it's supposed to be universal for different languages. For this purpose I have a .properties file which looks something like this.</p>
  <pre><code>40=forty
  
  50=fifty
  
  80=eighty
  
  teen=teen
  
  tens-suffix=ty
  
  tens-after-delimiter=-
  </code></pre>
  <p>This is my code so far:</p>
  <pre><code> public String numberInWords(Integer number) {
  
      Properties properties = new Properties();
      FileInputStream is = null;
  
      try {
          is = new FileInputStream(filePath);
  
          InputStreamReader reader = new InputStreamReader(
                  is, StandardCharsets.ISO_8859_1);
  
          properties.load(reader);
      } catch (Exception e) {
          // handle exceptions
      } finally {
          close(is);
      }
  </code></pre>
  <p>I know that I can get number values like this:</p>
  <pre><code>properties.getProperty(String.valueOf(number));
  </code></pre>
  <p>But how am I supposed to add the value &quot;teen&quot; to the result string?
  I tried something along the lines like the last line of code but my IDE says it cannot resolve the symbol.</p>
  <p>Thanks</p>
  <p>Edit:</p>
  <p>This was an example property file. I am well aware that adding &quot;teen&quot; won't work with other languages. In my property files I already have exceptions like 11 - eleven, 12 - twelve and so on. For example in my estonian property file I have a line:</p>
  <p>teen=teist,</p>
  <p>this will work on all estonian numbers. I need to find a way to add the teen value to a string. If an input is estonian, it will use the estonian property file and so on. This is determined in my other method.</p>
  <p>I am trying to find a method that allows me to get the value teen=&quot;something&quot; from a property file so I can add this to the string. Every property file is separate and has exceptions in them.</p>
  <p>This line won't work, because it cannot resolve symbol teen:</p>
  <p>properties.getProperty(String.valueOf(teen));</p>
  <p>I am looking for a solution for this exact probleem</p>