Skip to content

Commit

Permalink
Fix issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Isira-Seneviratne committed Aug 27, 2020
1 parent 5de54b0 commit b816b26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,8 @@ class AddLocalizedNameAdapter(
private fun getLanguageMenuItemTitle(languageTag: String): String {
if (languageTag.isEmpty()) return context.getString(R.string.quest_streetName_menuItem_nolanguage)
if (languageTag == "international") return context.getString(R.string.quest_streetName_menuItem_international)
val languageCode = languageTag.substringBefore('-')
val isRomanization = languageTag.endsWith("Latn")
val locale = Locale.forLanguageTag(languageCode)
val locale = Locale.forLanguageTag(languageTag)

val displayLanguage = locale.displayLanguage
val nativeDisplayLanguage = locale.getDisplayLanguage(locale)
Expand All @@ -154,17 +153,7 @@ class AddLocalizedNameAdapter(
)
}
} else {
if (displayLanguage == nativeDisplayLanguage) {
String.format(
context.getString(R.string.quest_streetName_menuItem_language_with_script_simple),
languageTag, displayLanguage, context.getString(R.string.quest_streetName_menuItem_romanized)
)
} else {
String.format(
context.getString(R.string.quest_streetName_menuItem_language_with_script_native),
languageTag, nativeDisplayLanguage, displayLanguage, context.getString(R.string.quest_streetName_menuItem_romanized)
)
}
return locale.displayScript
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class AddRoadNameForm : AAddLocalizedNameForm<RoadNameAnswer>() {
override fun onClickOk(names: List<LocalizedName>) {
val possibleAbbreviations = LinkedList<String>()
for ((languageTag, name) in adapter.localizedNames) {
val locale = Locale.forLanguageTag(languageTag)
val locale = if (languageTag.isEmpty()) countryInfo.locale else Locale.forLanguageTag(languageTag)
val abbr = abbreviationsByLocale.get(locale)
val containsLocalizedAbbreviations = abbr?.containsAbbreviations(name) == true

Expand Down

0 comments on commit b816b26

Please sign in to comment.