Skip to content

2.1.0

Latest

Choose a tag to compare

@founding5067 founding5067 released this 26 Nov 17:38
6bd5fe4

Localization

TimeLabels can now write labels in your app's language. You supply the words and a locale; the package ships no translations.

Added

  • TimeLabel.Language: the words and locale used to write labels, with .english as the default
  • TimeLabel.UnitForm: tells your language which spelling of a unit is needed
  • language: parameter on every label function and Date extension
  • .timeLabelLanguage(_:) view modifier and timeLabelLanguage environment value for TimeLabelText
  • TimeLabelText { now, language in ... } for custom live labels

Changed

  • dateTime's separator: is now optional and defaults to the language's separator (" at " in English)

Compatibility

  • Output without language: is the same as in 2.0.0
  • Code that stores a label function in a typed variable needs the new parameter added to its type

Limitations

  • spellNumbers doesn't adjust for grammatical gender or case
  • Counts and countdown timers always use the digits 0–9

See Localization in the README for setup.

Full Changelog: 2.0.0...2.1.0