Skip to content

Commit

Permalink
feat: Added formatter, values, path to MessageContext (#1271)
Browse files Browse the repository at this point in the history
* feat: Added formatter, values, path to MessageContext

* Making messages & locale available from message function

* Added 'linked' message functionality

* Re-built dist

Co-authored-by: Fabians <fabians.printful@gmail.com>
Co-authored-by: Fabians <kristaps.fabians@printful.com>
  • Loading branch information
3 people committed Jul 16, 2021
1 parent afedc76 commit fdb6bc1
Show file tree
Hide file tree
Showing 14 changed files with 1,683 additions and 515 deletions.
8 changes: 7 additions & 1 deletion decls/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ declare type Path = string;
declare type Locale = string;
declare type MessageContext = {
list: (index: number) => mixed,
named: (key: string) => mixed
named: (key: string) => mixed,
linked: (key: string) => TranslateResult,
values: any,
path: string,
formatter: Formatter,
messages: LocaleMessages,
locale: Locale
}
declare type MessageFunction = (ctx: MessageContext) => string
declare type FallbackLocale = string | string[] | false | { [locale: string]: string[] };
Expand Down

0 comments on commit fdb6bc1

Please sign in to comment.