Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions src/SearchResultItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down