@sveltekit-i18n/parser-default
Advanced tools
Comparing version 1.0.0-beta.2 to 1.0.0-beta.3
@@ -0,1 +1,3 @@ | ||
import { Parse } from '@sveltekit-i18n/base'; | ||
type ModifierOption = Record<'key' | 'value', string>; | ||
@@ -12,9 +14,3 @@ | ||
type Parser = (options: ParserOptions) => { | ||
parse: (props: { | ||
translations: Record<string, Record<string, any>>; | ||
key: string; | ||
payload?: Record<any, any>; | ||
locale?: string; | ||
fallbackLocale?: string; | ||
}) => string | ||
parse: Parse<Record<any | 'default', any>>; | ||
}; | ||
@@ -21,0 +17,0 @@ |
{ | ||
"name": "@sveltekit-i18n/parser-default", | ||
"version": "1.0.0-beta.2", | ||
"version": "1.0.0-beta.3", | ||
"description": "Default parser for sveltekit-i18n library.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -1,2 +0,2 @@ | ||
[![npm version](https://badge.fury.io/js/@sveltekit-i18n%2Fparser-default.svg)](https://badge.fury.io/js/@sveltekit-i18n%2Fparser-default) ![](https://github.com/sveltekit-i18n/parsers/workflows/Tests/badge.svg) | ||
[![npm version](https://badge.fury.io/js/@sveltekit-i18n%2Fparser-default.svg)](https://badge.fury.io/js/@sveltekit-i18n%2Fparser-default) ![](https://github.com/sveltekit-i18n/parsers/workflows/Tests/badge.svg) [![Tests](https://github.com/sveltekit-i18n/parsers/actions/workflows/tests-parser-default.yml/badge.svg)](https://github.com/sveltekit-i18n/parsers/actions/workflows/tests-parser-default.yml) | ||
@@ -26,7 +26,6 @@ # @sveltekit-i18n/parser-default | ||
## Message format | ||
## Syntax | ||
Your translations should be formatted as dot-notated objects containing strings as translation values. You can use `placehoders` and `modifiers` for interpolation. | ||
Example: | ||
Every [placeholder](#placeholders) or [modifiers](#modifiers) starts with `{{` and ends with `}}` and can be included in your translations like this: | ||
```jsonc | ||
@@ -67,3 +66,3 @@ { | ||
``` | ||
This value is used in case no `default` value is defined within the placeholder definition itself. For more, see `Dynamic default` section in [custom-modifiers](https://github.com/sveltekit-i18n/lib/tree/master/examples/custom-modifiers) example. | ||
This value is used in case no `default` value is defined within the placeholder definition itself. For more, see `Dynamic default` section in [parser-default](https://github.com/sveltekit-i18n/lib/tree/master/examples/parser-default) example. | ||
@@ -92,3 +91,3 @@ ### Modifiers | ||
You can include your own modifiers in the [Config](#custommodifiers-recordstring-value-string-options-arraykey-string-value-string-defaultvalue-string--string)! See [Examples](https://github.com/sveltekit-i18n/lib/tree/master/examples). | ||
You can include your own modifiers in [Options](#options)! See `parser-default` example in [Examples](https://github.com/sveltekit-i18n/lib/tree/master/examples). | ||
@@ -95,0 +94,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
14769
40
108