Skip to content

Releases: osm-americana/diplomat

v0.6.0

Choose a tag to compare

@1ec5 1ec5 released this 04 Aug 02:14

Changes since v0.5.0:

  • Added support for MapLibre GL JS v6.x. (#67)
  • Added the getResolvedLocaleExpression() function. The returned expression indicates which locale localizedName etc. 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

Choose a tag to compare

@1ec5 1ec5 released this 28 Apr 22:47

This package now requires MapLibre GL JS v5.22.0 or above.

Other changes since v0.4.0:

  • Reduced the size and complexity of generated text-field expressions 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

Choose a tag to compare

@1ec5 1ec5 released this 19 Feb 07:45

Changes since v0.3.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 prefers zh, Diplomat will first look for name:zh-Hans-CN, name:zh-Hans, and name:zh-CN before falling back to name:zh. (#30)

v0.3.0

Choose a tag to compare

@1ec5 1ec5 released this 23 Dec 02:09

Changes since v0.2.1:

  • maplibregl.Map.prototype.localizeStyle() is also available as maplibregl.Diplomat.localizeStyle(), for use when importing Diplomat as a module. (#14)
  • Added the sourceLayers option to maplibregl.Diplomat.localizeStyle() for making localizable a set of style layers associated with certain source layers. (#16)
  • Added the glossLocalNames option to maplibregl.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

Choose a tag to compare

@1ec5 1ec5 released this 29 Nov 19:02

Changes since v0.2.0:

  • Updated the built index.js in the dist/ folder that unpkg was distributing to reflect the v0.2 code rather than v0.1.0.
  • Corrected the usage example for maplibregl.Diplomat.getGlobalStateForLocalization().

v0.2.0

Choose a tag to compare

@1ec5 1ec5 released this 29 Nov 01:47

Changes since v0.1.0:

  • ⚠️ Breaking: Replaced maplibregl.Map.prototype.localizeLayers() with maplibregl.Map.prototype.localizeStyle(). This method automatically manipulates all the layers and upgrades any unlocalizable layers to be localizable based on sensible defaults. The raw maplibre.Diplomat.localizeLayers() function and the constants such as maplibre.Diplomat.localizedNameWithLocalGloss remain available for more fine-grained control. (#9)
  • ⚠️ Breaking: Removed the undocumented countryNamesByCode global variable in favor of maplibregl.Diplomat.getGlobalStateForLocalization() for setting up country name localization and maplibregl.Diplomat.getLocalizedCountryNameExpression() for getting an expression for getting a country name. (#9)

v0.1.0

Choose a tag to compare

@1ec5 1ec5 released this 27 Nov 00:35

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.