[gnome-maps] Place: Add wheelchair translations



commit 25107636358f9a1437685ecdd751f60ebf95b47a
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Thu Nov 13 03:58:05 2014 -0500

    Place: Add wheelchair translations
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726625

 po/POTFILES.in            |    1 +
 src/place.js              |   37 +++++++++++++++++++++++++++++++++++++
 src/searchResultBubble.js |    2 +-
 3 files changed, 39 insertions(+), 1 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 457f9ff..c9aeed6 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -9,6 +9,7 @@ src/geoclue.js
 src/mainWindow.js
 [type: gettext/glade]src/main-window.ui
 src/mapView.js
+src/place.js
 src/routeService.js
 src/searchResultBubble.js
 src/sidebar.js
diff --git a/src/place.js b/src/place.js
index 664d154..dccb949 100644
--- a/src/place.js
+++ b/src/place.js
@@ -20,6 +20,8 @@
  * Author: Jonas Danielsson <jonas threetimestwo org>
  */
 
+const _ = imports.gettext.gettext;
+
 const Geocode = imports.gi.GeocodeGlib;
 const Lang = imports.lang;
 
@@ -98,6 +100,41 @@ const Place = new Lang.Class({
         return this._wheelchair;
     },
 
+    get wheelchairTranslated() {
+        return this._translateWheelchair(this._wheelchair);
+    },
+
+    _translateWheelchair: function(string) {
+        switch(string) {
+            /* Translators:
+             * This means wheelchairs have full unrestricted access.
+             */
+            case 'yes': return _("yes");
+
+            /* Translators:
+             * This means wheelchairs have partial access (e.g some areas
+             * can be accessed and others not, areas requiring assistance
+             * by someone pushing up a steep gradient).
+             */
+            case 'limited': return _("limited");
+
+            /* Translators:
+             * This means wheelchairs have no unrestricted access
+             * (e.g. stair only access).
+             */
+            case 'no': return _("no");
+
+            /* Translators:
+             * This means that the way or area is designated or purpose built
+             * for wheelchairs (e.g. elevators designed for wheelchair access
+             * only). This is rarely used.
+             */
+            case 'designated': return _("designated");
+
+            default: return null;
+        }
+    },
+
     toJSON: function() {
         let bounding_box = null;
 
diff --git a/src/searchResultBubble.js b/src/searchResultBubble.js
index ca164b8..3a1b705 100644
--- a/src/searchResultBubble.js
+++ b/src/searchResultBubble.js
@@ -108,7 +108,7 @@ const SearchResultBubble = new Lang.Class({
         }
 
         if (place.wheelchair) {
-            infos.push(_("Wheelchair access: %s").format(place.wheelchair));
+            infos.push(_("Wheelchair access: %s").format(place.wheelchairTranslated));
         }
 
         infos.forEach((function(info) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]