Opened 7 years ago

Last modified 8 months ago

#1094 new enhancement/feature request

Allow different locales for spoken directions, the interface and the default country (possibly more bugs)

Reported by: tomashnyk Owned by: KaZeR
Priority: minor Milestone: version 0.6.0
Component: core Version: git master
Severity: Keywords: espeak, directions, menu, osd, i18n, translation
Cc:

Description

The use case is as follows: I use Czech locale on my phone, live in France so I want France to be my default country but I would like the directions to be spoken in English (it sounds much better then in Czech with espeak) (the interface could be in English or Czech).

If I set language="fr_FR" in navit, and I set espeak to speak English, I get the default country to be France but the directions are in Czech with English pronunciations (i.e. not understandable) and the interface is in Czech. I learnt on IRC that that is due to the translation of the interface and the announcements have the same locale.

If I do not set language="fr_FR" in navit.xml and use export LANG=en_GB, I get good directions in English but the default country is the UK.

If I set language="fr_FR", using export LANG=en_GB before launching navit causes the interface, announcements to be in French (default country is also France). This seems to be a separate bug to me, but I am not sure.

Using export LC_ALL=en_GB (and language="fr_FR") results in the announcements and interface being in English but produces this warning on the command line: "navit:main_init:Warning: LC_ALL is set, this might lead to problems (e.g. strange positions from GPS)" I am sure if this is a bug or desired behaviour but http://wiki.navit-project.org/index.php/FAQ#Navit_speaks.21_But_it.27s_all_English... suggests this is a bug (or maybe not?).

Default locale on my phone is:

LANG=cs_CZ LC_CTYPE="cs_CZ" LC_NUMERIC=cs_CZ LC_TIME=cs_CZ LC_COLLATE="cs_CZ" LC_MONETARY=cs_CZ LC_MESSAGES=cs_CZ LC_PAPER=cs_CZ LC_NAME=cs_CZ LC_ADDRESS=cs_CZ LC_TELEPHONE=cs_CZ LC_MEASUREMENT=cs_CZ LC_IDENTIFICATION=cs_CZ LC_ALL=

Ideally, default country, the interface and the announcements could be different in terms of locale that affects those settings. I think that two attributes to config tag, for example default_country and language_interface would be a solution. Also, attribute language for tag speech should determine the words that are passed to the speaking engine.

Also, these attributes should have precedence over locales on the device that should be used only as a fallback. That is not the case currently. For me personally, a solution would be just for two attributes default_country and language_interface, with default country being independent of the language (I do not care so much about the language of navit interface).

Change History (6)

comment:1 Changed 7 years ago by mvglasow (2)

Common expat problem... :-)

The first part of the locale is the UI language, the second one is the default country. You can try "en_FR" or "cz_FR" - this will cause town search to default to France but give you an English (or Czech) UI and speech output. I have successfully done this with "en_IT" and "en_DE".

The only issue that remains is pronunciation of names. Here I indeed believe Navit could do better: The solution would be to pass instructions and names separately to the TTS engine, passing different languages each time. For the instruction that would be the UI language. For the names, choosing the right language may be tricky.

Setting the language by country already solves the majority of issues. This would work well in places like the Netherlands, Germany where place names are in the same language - the only thing that would be tricky would be the occasional foreign name such as streets named after foreigners. (Though that would somewhat resemble the pronunciation you might hear from some locals.) Things get trickier in multilingual countries like Belgium, where place names may be in any one of the languages spoken there, or even in all.

Here, the only approach that might work is to encode place name languages in a separate attribute. Maptool would have to look not only for the "name" tag but also for any translated "name:xx" tags. When the value of "name:xx" matches that of "name", then set the language attribute to "xx".

Note that this would only work where the local place name is in fact double-tagged, and it would not work with the Belgian tagging convention, which is "name = fr - nl" or "name = nl - fr" and additionally adding a "name:nl" and "name:fr" tag. Here, some extra logic would be needed.

There probably won't be a 100% solution, but I'm sure Navit can do this better than it currently does.

comment:2 Changed 7 years ago by tomashnyk

Oh, I was not aware that one can combine countries with languages that in real word are not officially spoken in those countries. Nice catch.

The bug for me seems to be that no matter what I set language to, I always get Czech interface, so there seems to be something broken with the language attribute. However, the default country changes.

After some digging, it seems that launching navit with: #!/bin/sh unset LC_MESSAGES export LANG=en_GB navit

results in the language of the interface and announcement to be taken from LANG (the "en" part, not the "GB" part). I do not see how that is not a bug, even though much narrower then the original. The information in the wiki should also be updated, as those lines are taken from there. I will look into that.

comment:3 Changed 7 years ago by tomashnyk

So I changed http://wiki.navit-project.org/index.php/Configuration/Full_list_of_options (description of language attribute to explicitly say that one can combine various countries and languages) and http://wiki.navit-project.org/index.php/FAQ#espeak_on_Linux (I described how to use language attribute to change the language and deleted detailed mentions how to change the locale as the language attribue is a much nicer solution. There is a sentence saying that it is possible to change the locale as well fro the daring).

comment:4 Changed 6 years ago by usul

  • Keywords espeak directions menu osd i18n translation added
  • Milestone set to version 0.5.1

Seems to be related to #997 and using markdown for the TTS to pronounce streetnames in the appropriate locale. Anyway, this requests a splitup of internal languages also navit.xml settings and menu/controls to adapt this settings.

I will schedule it for next hotfix, as #997, too. (maybe we should put it to next major release instead).

comment:5 Changed 2 years ago by http://wiki.navit-project.org/index.php/user:jkoan

  • Milestone changed from version 0.5.1 to version 0.5.2

This ticket was pushed back in order to bring 0.5.1 out soon.

comment:6 Changed 8 months ago by http://wiki.navit-project.org/index.php/user:jkoan

  • Milestone changed from version 0.5.2 to version 0.6.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.