Skip to content

Commit

Permalink
alphabetize and add russian (#112)
Browse files Browse the repository at this point in the history
* alphebetize and add russian

* add RU_RU test & update example languages list
  • Loading branch information
kevinkreiser authored and sarahsnow1 committed May 12, 2017
1 parent bfb5187 commit c168ee6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 3 additions & 2 deletions library/src/main/java/com/mapzen/valhalla/Router.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ package com.mapzen.valhalla
interface Router {

enum class Language(private val languageTag: String) {
CA_ES("ca-ES"),
CS_CZ("cs-CZ"),
DE_DE("de-DE"),
EN_US("en-US"),
PIRATE("en-US-x-pirate"),
ES_ES("es-ES"),
FR_FR("fr-FR"),
IT_IT("it-IT"),
HI_IN("hi-IN"),
CA_ES("ca-ES"),
IT_IT("it-IT"),
RU_RU("ru-RU"),
SL_SI("sl-SI");

override fun toString(): String {
Expand Down
6 changes: 6 additions & 0 deletions library/src/test/java/com/mapzen/valhalla/RouterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ public void shouldSetToSlSi() throws Exception {
assertThat(router.getJSONRequest().directionsOptions.language).contains("sl-SI");
}

@Test
public void shouldSetToRuRu() throws Exception {
router.setLanguage(Router.Language.RU_RU);
assertThat(router.getJSONRequest().directionsOptions.language).contains("ru-RU");
}

@Test
public void shouldDefaultToCar() throws Exception {
assertThat(router.getJSONRequest().costing).contains("auto");
Expand Down
7 changes: 5 additions & 2 deletions sample/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
<item>multimodal</item>
</string-array>
<string-array name="languages_array">
<item>CA_ES</item>
<item>CS_CZ</item>
<item>DE_DE</item>
<item>EN_US</item>
<item>PIRATE</item>
<item>ES_ES</item>
<item>FR_FR</item>
<item>IT_IT</item>
<item>HI_IN</item>
<item>IT_IT</item>
<item>FR_FR</item>
<item>RU_RU</item>
<item>SL_SI</item>
</string-array>
</resources>

0 comments on commit c168ee6

Please sign in to comment.