Skip to content

Commit

Permalink
Update Qwik to 1.4.3 & docs
Browse files Browse the repository at this point in the history
  • Loading branch information
robisim74 committed Feb 3, 2024
1 parent b2d9703 commit 5dba63f
Show file tree
Hide file tree
Showing 7 changed files with 851 additions and 767 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default component$(() => {
);
});
```
You can also avoid handling the keys, and only pass the default values by enabling the automatic key generation option:
You can pass only the default values by enabling the automatic key generation option:
```tsx
import { inlineTranslate } from 'qwik-speak';

Expand Down
10 changes: 10 additions & 0 deletions docs/extract.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Available options:
- `filename` Filename for not scoped translations. Default is `'app'`
- `fallback` Optional function to implement a fallback strategy
- `autoKeys` Automatically handle keys for each string. Default is false
- `unusedKeys` Automatically remove unused keys from assets, except in runtime assets
- `runtimeAssets` Comma-separated list of runtime assets to preserve
- `keySeparator` Separator of nested keys. Default is `'.'`
- `keyValueSeparator` Key-value separator. Default is `'@@'`

Expand Down Expand Up @@ -109,3 +111,11 @@ const fallback = (translation) => {
return translation;
};
```

### Automatic removal of unused keys
To remove unused keys from json files, you need to enable the option and provide a comma-separated list of runtime file names:
```json
"scripts": {
"qwik-speak-extract": "qwik-speak-extract --supportedLangs=en-US,it-IT --unusedKeys=true --runtimeAssets=runtime"
}
```
2 changes: 1 addition & 1 deletion docs/translate.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ If you don't want to handle the keys inside the translation functions, but only

> Note. You can enable this option, even if you use the syntax `key@@[default value]`.
If you enable this option, you can only pass the default value to the translation functions:
If you enable this option, you can pass only the default values to the translation functions:
```tsx
export default component$(() => {
const t = inlineTranslate();
Expand Down
Loading

0 comments on commit 5dba63f

Please sign in to comment.