Skip to content

Commit

Permalink
use different wording for floor and level(fix #3529)
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Nov 30, 2021
1 parent 75e1142 commit 1ef1891
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ fun Resources.getLocationLabelString(tags: Map<String, String>): CharSequence? {
}

private fun Resources.getLevelLabelString(tags: Map<String, String>): CharSequence? {
/* prefer addr:floor etc. over level as level is rather an index than how the floor is
denominated in the building and thus may (sometimes) not coincide with it. E.g.
addr:floor may be "M" while level is "2" */
val level = tags["addr:floor"] ?: tags["level:ref"] ?: tags["level"]
/* distinguish between "floor" and "level":
E.g. addr:floor may be "M" while level is "2". The "2" is in this case purely technical and
can not be seen on any sign. */
val floor = tags["addr:floor"] ?: tags["level:ref"]
if (floor != null) {
return getString(R.string.on_floor, floor)
}
val level = tags["level"]
if (level != null) {
return getString(R.string.on_level, level)
return getString(R.string.on_level, floor)
}
val tunnel = tags["tunnel"]
if(tunnel != null && tunnel == "yes" || tags["location"] == "underground") {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -748,8 +748,9 @@ Otherwise, you can download another keyboard in the app store. Popular keyboards
<string name="pref_title_quests_restore_hidden">Restore hidden quests</string>
<string name="restore_hidden_success">Restored %d hidden quests</string>

<!-- caution: This is not necessarily the floor and level=0 is not necessarily at street level as it may follow the numbering scheme of the building operator. Try to use a generic wording that does not carry an implicit meaning of where it is located in respect to the ground floor. The context is usually shopping centres, train stations or airport terminals -->
<!-- caution: This is not the floor and level=0 is not necessarily at street level as it may follow the numbering scheme of the building operator. Try to use a generic wording that does not carry an implicit meaning of where it is located in respect to the ground floor. The context is usually shopping centres, train stations or airport terminals -->
<string name="on_level">on level %s:</string>
<string name="on_floor">on floor %s:</string>
<!-- as in: “Where is the metro station?” - “It is underground” -->
<string name="underground">underground:</string>
<string name="quest_sidewalk_value_yes">sidewalk</string>
Expand Down

0 comments on commit 1ef1891

Please sign in to comment.