diff --git a/src/SearchResultItem.vala b/src/SearchResultItem.vala index 536c2a4..0a56ef7 100644 --- a/src/SearchResultItem.vala +++ b/src/SearchResultItem.vala @@ -15,13 +15,28 @@ public class Maps.SearchResultItem : Granite.Bin { set { _place = value; + image.gicon = place.icon; + name_label.label = place.name; + + if (place.street_address != null && place.town != null) { + ///TRANSLATORS: a street address, followed by a town or city + info_label.label = _("%s, %s").printf (place.street_address, place.town); + + return; + } + + if (place.place_type == TOWN && place.state != null && place.country != null) { + ///TRANSLATORS: a state or probince, followed by a country + info_label.label = _("%s, %s").printf (place.state, place.country); + + return; + } + var street = place.street ?? unknown_text; var postal_code = place.postal_code ?? unknown_text; var town = place.town ?? unknown_text; - image.gicon = place.icon; - name_label.label = place.name; - info_label.label = "%s, %s, %s".printf (street, postal_code, town); + info_label.label = "%s, %s, %s, %s".printf (street, postal_code, town, place.state); } }