Bug 296382 - OpenRouteService doesn’t work under Norwegian Nynorsk locale
Summary: OpenRouteService doesn’t work under Norwegian Nynorsk locale
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: 1.3 (KDE 4.8)
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-19 19:23 UTC by Karl Ove Hufthammer
Modified: 2012-04-12 16:04 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Ove Hufthammer 2012-03-19 19:23:25 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Build Identifier: 

OpenRouteService doesn’t work with certain locale settings. I use the Norwegian Nynorsk locale, and OpenRouteService never returns a route (but a Yours route is returned). If I start Marble with ‘LC_ALL=C marble’, everything works fine.

Reproducible: Always

Steps to Reproduce:
1. Change locale settings to Norwegian Nynorsk.
2. Start Marble.
3. Try to generate a route (with OpenRouteService checked).
Actual Results:  
No OpenRouteService route is returned.

Expected Results:  
OpenRouteService route should be returned.

May be related to bug #247339 (perhaps the fix used there doesn’t work anymore?).
Comment 1 Dennis Nienhüser 2012-04-12 13:44:30 UTC
The following works for me (git master and KDE/4.8):
LC_ALL=no marble
and I get instructions from OpenRouteService like this:
"Kjør halvt høyre på L 559"

Do I need to specify the locale in a different way?
Comment 2 Karl Ove Hufthammer 2012-04-12 14:03:09 UTC
Dennis, you use the wrong locale code. The correct locale code for Norwegian Nynorsk is nn or nn_NO. no is an old code deprecated for use as a locale code (but may be used as a language code for tagging non-written material), and is not used in KDE. Try LC_ALL=nn_NO marble
Comment 3 Dennis Nienhüser 2012-04-12 15:05:15 UTC
Thanks, I can reproduce it with nn. I'll commit a general fix for master soon and a reduced one (only fixing norwegian to avoid any side effects) to the KDE/4.8 branch.
Comment 4 Dennis Nienhüser 2012-04-12 15:20:59 UTC
Git commit 5468b9a4a09f9a5a683c9186d2fca969079ed458 by Dennis Nienhüser.
Committed on 12/04/2012 at 17:06.
Pushed by nienhueser into branch 'master'.

Parse ORS turn instructions and generate our own ones from it.

Retrieving localized instructions from ORS for a couple of (atm 28)
languages is possible, but the list cannot be queried and the somewhat
complicated needed fall-back behavior lead to regressions earlier
(bug 296382, bug 247339).
Instead query english instructions now, parse them and generate our own
instructions for them (localized). This means that we can cover more
languages now and (more important) can indicate the turn type correctly,
which enables voice guidance for ORS (previously only a sound could be
played).
The drawback is that once ORS changes the english instructions, parsing
will fail, so we'd be back at not localized instructions at that point.
Still better than having no route at all, of course.

M  +56   -5    src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
M  +3    -0    src/plugins/runner/openrouteservice/OpenRouteServiceRunner.h

http://commits.kde.org/marble/5468b9a4a09f9a5a683c9186d2fca969079ed458
Comment 5 Dennis Nienhüser 2012-04-12 16:04:31 UTC
Git commit 261bb62524423d4b5e18425ef55790923a33af07 by Dennis Nienhüser.
Committed on 12/04/2012 at 17:57.
Pushed by nienhueser into branch 'KDE/4.8'.

Fix localization of ORS turn instructions.

Restricts the localization to those languages listed in
http://wiki.openstreetmap.org/wiki/OpenRouteService/Instructions
Furthermore maps norwegian and swedish language codes to those used
by ORS.

M  +30   -1    src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp

http://commits.kde.org/marble/261bb62524423d4b5e18425ef55790923a33af07