Open lucaswoj opened 7 years ago
From https://github.com/mapbox/DEPRECATED-mapbox-gl/issues/21#issuecomment-261338156:
There are two proposals so far in this ticket:
- A
text-language
layout property that accepts tokens just astext-field
would;text-language
would affect at least text transforms but potentially also font fallbacks in the future. If the designer setstext-field
to{name_tr}
, then they can settext-language
totr
. But if they want to settext-field
to{name}
, they’d need Mapbox Streets to provide aname_language
property on each individual feature.- Alternatively, a mapping – somewhere, maybe in the style JSON, maybe in TileJSON – from vector tile properties to language codes that Mapbox GL would consult any time it tries to transform text that originates in one of these vector tile properties. So if
text-field
is{name_de} — {name_en}
andtext-transform
isuppercase
, then Mapbox GL would know to uppercase thename_de
value with the German locale before inserting it into the overall string. Indicating the language of thename
field per-feature would be out of scope.It’s entirely possible that both proposals are rubegoldbergian and there are simpler ways to accomplish locale-aware text transforms. Any ideas?
This doesn't solve the dotted I problem but would't upper('ß')
→'SS'
always be a safe/reasonable thing to do in the context of rendering text on a map? Could that be the default locale-less behavior?
That is the behavior when the locale goes unspecified on some platforms, including iOS and macOS, but apparently not including the Web.
@ajashton in the particular case of ß => SS, you are mostly right (there are fonts which support an uppercase ß (ẞ) but it's not in wide use.
Migrated from https://github.com/mapbox/DEPRECATED-mapbox-gl/issues/21 by @1ec5
cc @mapbox/gl @mapbox/cartography-cats @kkaefer @jfirebaugh