#include "plugin.h"
#include "navit_nls.h"
-#define DEBUG
+/* #define DEBUG */
struct suffix {
char *fullname;
int distance_turn;
struct callback *route_cb;
int announce[route_item_last-route_item_first+1][3];
+ int tell_street_name;
};
navigation_new(struct attr *parent, struct attr **attrs)
{
int i,j;
+ struct attr * attr;
struct navigation *ret=g_new0(struct navigation, 1);
ret->hash=item_hash_new();
ret->callback=callback_list_new();
ret->distance_turn=50;
ret->turn_around_limit=3;
ret->navit=parent->u.navit;
+ ret->tell_street_name=1;
for (j = 0 ; j <= route_item_last-route_item_first ; j++) {
for (i = 0 ; i < 3 ; i++) {
}
}
+ if ((attr=attr_search(attrs, NULL, attr_tell_street_name))) {
+ ret->tell_street_name = attr->u.num;
+ }
+
return ret;
}
{
switch (n) {
case 0:
- return _("zeroth"); // Not shure if this exists, neither if it will ever be needed
+ return _("zeroth"); // Not sure if this exists, neither if it will ever be needed
case 1:
return _("first");
case 2:
{
switch (n) {
case 0:
- return _("zeroth exit"); // Not shure if this exists, neither if it will ever be needed
+ return _("zeroth exit"); // Not sure if this exists, neither if it will ever be needed
case 1:
return _("first exit");
case 2:
int rem=(dist/100)%10;
if (rem) {
if (is_length)
- return g_strdup_printf(_("%d.%d kilometer"), dist/1000, rem);
+ return g_strdup_printf(_("%d.%d kilometers"), dist/1000, rem);
else
return g_strdup_printf(_("in %d.%d kilometers"), dist/1000, rem);
}
ret->item=*sitem;
item_hash_insert(this_->hash, sitem, ret);
mr=map_rect_new(sitem->map, NULL);
- sitem=map_rect_get_item_byid(mr, sitem->id_hi, sitem->id_lo);
+ if (! (sitem=map_rect_get_item_byid(mr, sitem->id_hi, sitem->id_lo)))
+ return NULL;
if (item_attr_get(sitem, attr_street_name, &attr))
ret->name1=map_convert_string(sitem->map,attr.u.str);
if (item_attr_get(sitem, attr_street_name_systematic, &attr))
}
if (cmd->itm->next) {
int tellstreetname = 0;
- char *destination = NULL;
+ char *destination = NULL;
if(type == attr_navigation_speech) { // In voice mode
// In Voice Mode only tell the street name in level 1 or in level 0 if level 1
else
tellstreetname = 1;
- if(tellstreetname)
+ if(nav->tell_street_name && tellstreetname)
destination=navigation_item_destination(cmd->itm, itm, " ");
+
if (level != -2) {
/* TRANSLATORS: The first argument is strength, the second direction, the third distance and the fourth destination Example: 'Turn 'slightly' 'left' in '100 m' 'onto baker street' */
ret=g_strdup_printf(_("Turn %1$s%2$s %3$s%4$s"), strength, dir, d, destination ? destination:"");