@vocab/types
Advanced tools
Comparing version 0.0.7 to 0.0.8
# @vocab/types | ||
## 0.0.8 | ||
### Patch Changes | ||
- [`f2fca67`](https://github.com/seek-oss/vocab/commit/f2fca679c66ae65405a0aa24f0a0e472026aad0d) [#36](https://github.com/seek-oss/vocab/pull/36) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Support custom locales for ICU message parsing | ||
## 0.0.7 | ||
@@ -4,0 +10,0 @@ |
@@ -7,3 +7,3 @@ import type { IntlMessageFormat } from 'intl-messageformat'; | ||
export declare type TranslationModule<TranslatedLanguage> = { | ||
getValue: () => ParsedICUMessages<TranslatedLanguage> | undefined; | ||
getValue: (locale: string) => ParsedICUMessages<TranslatedLanguage> | undefined; | ||
load: () => Promise<void>; | ||
@@ -10,0 +10,0 @@ }; |
{ | ||
"name": "@vocab/types", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"main": "dist/vocab-types.cjs.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/vocab-types.esm.js", |
@@ -87,3 +87,3 @@ # Vocab | ||
You can then import these translations into your React components. Translations can be used by calling the `t` function returned by `useTranslation`. | ||
You can then import these translations into your React components. Translations can be used by calling the `t` function returned by `useTranslations`. | ||
@@ -93,7 +93,7 @@ **./MyComponent.tsx** | ||
```tsx | ||
import { useTranslation } from '@vocab/react'; | ||
import { useTranslations } from '@vocab/react'; | ||
import translations from './example.vocab'; | ||
function MyComponent({ children }) { | ||
const { t } = useTranslation(translations); | ||
const { t } = useTranslations(translations); | ||
return <div>{t('my key')}</div>; | ||
@@ -100,0 +100,0 @@ } |
@@ -14,3 +14,5 @@ import type { IntlMessageFormat } from 'intl-messageformat'; | ||
export type TranslationModule<TranslatedLanguage> = { | ||
getValue: () => ParsedICUMessages<TranslatedLanguage> | undefined; | ||
getValue: ( | ||
locale: string, | ||
) => ParsedICUMessages<TranslatedLanguage> | undefined; | ||
load: () => Promise<void>; | ||
@@ -17,0 +19,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12819
126