Skip to content

Commit

Permalink
chores: prepare for next
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiin committed Apr 24, 2024
1 parent 329c126 commit 2a3d2f4
Show file tree
Hide file tree
Showing 87 changed files with 2,161 additions and 1,247 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -31,7 +31,7 @@

## Getting started

To get started follow the [**quickstart**](https://nestjs-i18n.com/quick-start), or take a look at the [**docs**](https://nestjs-i18n.com/).
To get started follow the [**quickstart**](https://nestjs-i18n.com/quick-start), or take a look at the [**docs**](https://nestjs-i18n.com/).

## License

Expand Down
25 changes: 3 additions & 22 deletions docs/guides/type-safety.md
Expand Up @@ -52,6 +52,9 @@ export class AppController {
}
```

:::tip
You can import the `I18nPath` type so you require a valid i18n path in your code. This is useful when handeling exceptions with translations.

```typescript title="src/app.service.ts"
import { Injectable } from '@nestjs/common';
import { I18nContext, I18nService } from 'nestjs-i18n';
Expand All @@ -70,28 +73,6 @@ export class AppService {
}
}
```


:::tip
You can import the `I18nPath` type so you require a valid i18n path in your code. This is useful when handeling exceptions with translations.

```typescript title="src/app.controller.ts"
import { I18nPath } from './generated/i18n.generated.ts';

export class ApiException extends Error {
get translation(): I18nPath {
return this.message as I18nPath;
}

get args(): any {
return this._args;
}

constructor(key: I18nPath, private readonly _args?: any) {
super(key);
}
}
```
:::

:::caution
Expand Down

0 comments on commit 2a3d2f4

Please sign in to comment.