title: Android: Language support, spinner options
body: <p>I have a spinner in my app where the user chooses whether he wants to search by "Contains" "Starts with" "Ends with" or "Equals", The option user selects is stored into a json with other information and sent to server to retrieve results.  Now I'm using:</p>
  
  <pre><code>String searchtypeval=searchtype.getSelectedItem().toString();
  </code></pre>
  
  <p>and adding  <code>searchtypeval</code> into my json.
  The String-array in the spinner is</p>
  
  <pre><code>    &lt;string-array name="search_options"&gt;
          &lt;item&gt;Starts With&lt;/item&gt;
          &lt;item&gt;Equals&lt;/item&gt;
          &lt;item&gt;Ends With&lt;/item&gt;
          &lt;item&gt;Contains&lt;/item&gt;
      &lt;/string-array&gt;
  </code></pre>
  
  <p>But now I'm adding language support so in <code>values-fr/strings.xml</code> the string array for that spinner is</p>
  
  <pre><code>&lt;string-array name="search_options"&gt;
      &lt;item&gt;Commence par &lt;/item&gt;
      &lt;item&gt;Égal &lt;/item&gt;
      &lt;item&gt;Se termine par &lt;/item&gt;
      &lt;item&gt;Contient &lt;/item&gt;
  &lt;/string-array&gt;
  </code></pre>
  
  <p>Now if the user selects equals in french , <em>Egal</em> is stored into the JSON which of course the server doesn't accept. Is there any way I can make a connection between the french and the english <code>strings.xml</code>? All I can think of now is to use <code>searchtype.getSelectedItemPosition()</code>
  and hard code the value into <code>String searchtypeval</code> since I know which option is which position, but this seems very cumbersome, is there any method to solve this issue that is more elegant? </p>