Releases: osm-americana/diplomat
Releases · osm-americana/diplomat
Release list
v0.6.0
- Added support for MapLibre GL JS v6.x. (#67)
- Added the
getResolvedLocaleExpression()function. The returned expression indicates which localelocalizedNameetc. actually result in when there are multiple locales in the fallback list. (#48) - Fixed an error calling
getLocales()outside a browser environment. (#66)
v0.5.0
This package now requires MapLibre GL JS v5.22.0 or above.
- Reduced the size and complexity of generated
text-fieldexpressions by more than half, improving performance in stylesheets with many layers. (#46) - An unlimited number of semicolon-delimited names are recognized in
name, up from a maximum of three in previous releases. (#46) - If the name in the preferred language matches more than one name in
name, only the first match is removed from the local name gloss. The rest remain in the gloss, for consistency with when that name does not match the name in the preferred language. (#46) - Restored some documentation for clients written in TypeScript. (#38, thanks @k-yle)
v0.4.0
- Added TypeScript type declarations. (#29, thanks @simonengelhardt)
- Added the
getRelatedLanguageTags()method for getting all the related variations of a given language tag. (#30) getLocales()more aggressively matches localized name properties. For example, if the user preferszh, Diplomat will first look forname:zh-Hans-CN,name:zh-Hans, andname:zh-CNbefore falling back toname:zh. (#30)
v0.3.0
maplibregl.Map.prototype.localizeStyle()is also available asmaplibregl.Diplomat.localizeStyle(), for use when importing Diplomat as a module. (#14)- Added the
sourceLayersoption tomaplibregl.Diplomat.localizeStyle()for making localizable a set of style layers associated with certain source layers. (#16) - Added the
glossLocalNamesoption tomaplibregl.Diplomat.localizeStyle()for appending the name in the local language to any style layer that the method makes localizable. (#23) - Minified the built code for a 65% reduction in size. (#15)
v0.2.1
v0.2.0
⚠️ Breaking: Replacedmaplibregl.Map.prototype.localizeLayers()withmaplibregl.Map.prototype.localizeStyle(). This method automatically manipulates all the layers and upgrades any unlocalizable layers to be localizable based on sensible defaults. The rawmaplibre.Diplomat.localizeLayers()function and the constants such asmaplibre.Diplomat.localizedNameWithLocalGlossremain available for more fine-grained control. (#9)⚠️ Breaking: Removed the undocumentedcountryNamesByCodeglobal variable in favor ofmaplibregl.Diplomat.getGlobalStateForLocalization()for setting up country name localization andmaplibregl.Diplomat.getLocalizedCountryNameExpression()for getting an expression for getting a country name. (#9)
v0.1.0
Initial release featuring:
- Methods and placeholder constants for localizing symbol layers
- Support for OpenMapTiles- and Tilezen-compatible tilesets
- Automatic deduplication of names shared between preferred and local languages
- Parsing of semicolon-delimited value lists
- Utilities for discovering the user’s preferred language
- Basic language fallbacks
See osm-americana/openstreetmap-americana#914 for background context.