You mean automatic transliteration? Yes of course, I’d even say this would be the preferred way. However, if a second name is given on the street sign itself, I think it is reasonable to also record that name. If only because sometimes, the romanization used on the street sign is not the correct one, so it is good to record the name as written on the sign.
Are you sure about this? name:xx-Latn is not exactly fringe tagging, it is used massively in Korea and Japan. Any software that works for these countries, will have to implement a fallback like that.
Also, what about the support for int_name then?
Yesterday, I noticed that in StreetComplete itself, there is not a proper fallback, so I tried to implement both int_name and name:xx-Latn. I ultimatively failed and I failed at int_name actually. Here is some insight into my experience:
function getDisplayName(tags: Map<String,String>, userLang: String, userScript: String, countryLang: String, countryScript: String)
{
// for example, userLang="de", userScript="Latn"
// Preference #1: Take name in own language. No problem here
val nameInUserLang = tags["name:" + userLang]
if (nameInUserLang ) return nameInUserLang
// Preference #2: Take "International" name.
val internationalName = tags["int_name"]
if (countryLang != userLang && internationalName) return internationalName
/* PROBLEMS!
1. Where to get information from in which country the element this is about is located? Need a country-level
reverse geocoder that works extremely fast, because it is going to be queried for every single element
that theoretically has a name!
2. Where to get information from what language is spoken in that country? Need a complete list of language
by country. What if the country has several (official) languages?
This MAY be solved differently but only if the name in the country's language is ALSO tagged as name:xx
alongside the normal name tag. Because through this, the official language of the element can be ascertained.
*/
// Preference #3: Take name that is at readable in user's script (usually: romanized name)
val nameInUserScript = tags["name:" + countryLang + "-" + userScript]
if (countryScript != userScript && nameInUserScript) return nameInUserScript
/* PROBLEMS!
1. Same as above, where to get the language info for the country from?
2. Where to get the information from what language uses which script? Some languages optionally use several
scripts
Unlike for "int_name", point 1 can be solved differently so no geocoder is necessary: Just take ANY name in the
user's script (for example using regex "^name:([a-z]{2,3})-Latn$") if the script of the language in the tag has
a different script than the user's script.
*/
// Preference #4: Take name in English (cause it's kind of "international") language
...
// Preference #5: Take name that is readable in Latin (cause it's kind of "international") script
...
// Preference #6: Take name of any other language whose script is the same as the user's script
...
// Preference #7: Take name of any other language whose script is in Latin (cause it's kind of "international") script
...
// Otherwise, normal name
return tags["name"]
}
Ok, this code snippet got longer than expected, mostly because of the extensive comments. The learning from this attempted implementation are
-
For most reasonable fallbacks, it must be known what is the language used in the name tag. So for data consumers, it is very convenient if the name is duplicated into the name:xx key. However, a proper solution always requires a reverse geocoder by country (I wrote one for StreetComplete) and a list of official languages by country code (I did that for StreetComplete)
-
It is pretty much the same complexity to implement name:xx-Latn as int_name