Expose currencies as token data types and add some fancy dynamic token replacements. Use cases? Payment sets ISO4217 currency codes for its payments. In hook_entity_property_info() it could say Payment::currency_code is a "currency" type, which allows Token to dynamically expose all data from Currency when dealing with payments.

CommentFileSizeAuthor
#2 currency_1531954_00.patch3.83 KBxano

Comments

xano’s picture

Assigned: Unassigned » xano

Tokens could also insert human-readable currency names, but how do we internationalize/localize those?

xano’s picture

Status: Active » Needs review
StatusFileSize
new3.83 KB

The patch adds five tokens:

  • [currency:code]
  • [currency:number]
  • [currency:minor-unit]
  • [currency:sign]
  • [currency:title]

The title is taken directly from the Currency object after it is loaded. We should deal with i18n/l10n, but in a follow-up issue, because that's not just a token thing.

xano’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

xano’s picture

Assigned: xano » Unassigned