[gnome-maps] Add tag religion to map bubbles
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] Add tag religion to map bubbles
- Date: Tue, 30 May 2017 20:08:48 +0000 (UTC)
commit e179346617e54d1e0562d5aa9883e4a7e545399a
Author: Robert Ancell <robert ancell canonical com>
Date: Tue May 30 09:09:47 2017 +1200
Add tag religion to map bubbles
https://bugzilla.gnome.org/show_bug.cgi?id=783185
src/overpass.js | 2 ++
src/place.js | 18 +++++++++++++++++-
src/placeBubble.js | 5 +++++
src/translations.js | 27 +++++++++++++++++++++++++++
4 files changed, 51 insertions(+), 1 deletions(-)
---
diff --git a/src/overpass.js b/src/overpass.js
index b276ccf..a12a628 100644
--- a/src/overpass.js
+++ b/src/overpass.js
@@ -108,6 +108,8 @@ const Overpass = new Lang.Class({
place.internetAccess = element.tags.internet_access;
if (element.tags.ele && place.location)
place.location.altitude = parseFloat(element.tags.ele);
+ if (element.tags.religion)
+ place.religion = element.tags.religion
},
_getQueryUrl: function(place) {
diff --git a/src/place.js b/src/place.js
index aa60f55..931f074 100644
--- a/src/place.js
+++ b/src/place.js
@@ -52,6 +52,9 @@ const Place = new Lang.Class({
this._internetAccess = params.internetAccess;
delete params.internetAccess;
+ this._religion = params.religion;
+ delete params.religion;
+
/* Determines if the place should be added to the place store */
if (typeof(params.store) === 'undefined') {
this._store = true;
@@ -158,6 +161,18 @@ const Place = new Lang.Class({
return Translations.translateInternetAccess(this._internetAccess);
},
+ set religion(v) {
+ this._religion = v;
+ },
+
+ get religion() {
+ return this._religion;
+ },
+
+ get religionTranslated() {
+ return Translations.translateReligion(this._religion);
+ },
+
set wheelchair(v) {
this._wheelchair = v;
},
@@ -241,7 +256,8 @@ const Place = new Lang.Class({
wiki: this.wiki,
wheelchair: this.wheelchair,
openingHours: this.openingHours,
- internetAccess: this.internetAccess };
+ internetAccess: this.internetAccess,
+ religion: this.religion };
},
match: function(searchString) {
diff --git a/src/placeBubble.js b/src/placeBubble.js
index b437e2d..decf0d4 100644
--- a/src/placeBubble.js
+++ b/src/placeBubble.js
@@ -139,6 +139,11 @@ const PlaceBubble = new Lang.Class({
info: place.internetAccessTranslated });
}
+ if (place.religion) {
+ expandedContent.push({ label: _("Religion:"),
+ info: place.religionTranslated });
+ }
+
if (place.wheelchair) {
expandedContent.push({ label: _("Wheelchair access:"),
info: place.wheelchairTranslated });
diff --git a/src/translations.js b/src/translations.js
index bf142ab..e9a2307 100644
--- a/src/translations.js
+++ b/src/translations.js
@@ -358,3 +358,30 @@ function translateInternetAccess(string) {
}
}
+function translateReligion(string) {
+ switch(string) {
+ case 'animist': return _("Animism");
+ case 'bahai': return_("Bahá'í");
+ case 'buddhist': return _("Buddhism");
+ case 'caodaism': return _("Caodaism");
+ case 'christian': return _("Christianity");
+ case 'confucian': return _("Confucianism");
+ case 'hindu': return _("Hinduism");
+ case 'jain': return _("Jainism");
+ case 'jewish': return _("Judaism");
+ case 'muslim': return _("Islam");
+ case 'multifaith': return _("Multiple Religions");
+ case 'pagan': return _("Paganism");
+ case 'pastafarian': return _("Pastafarianism");
+ case 'scientologist': return _("Scientology");
+ case 'shinto': return _("Shinto");
+ case 'sikh': return _("Sikhism");
+ case 'spiritualist': return _("Spiritualism");
+ case 'taoist': return _("Taoism");
+ case 'unitarian_universalist': return _("Unitarian Universalism");
+ case 'voodoo': return _("Voodoo");
+ case 'yazidi': return _("Yazidism");
+ case 'zoroastrian': return _("Zoroastrianism");
+ default: return null;
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]