Skip to content

Commit

Permalink
Merge pull request #567 from toonvanstrijp/faq
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiin committed Sep 19, 2023
2 parents 07b6074 + 78ecbaf commit 8a46b18
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion docs/faq/common.md
Expand Up @@ -5,7 +5,24 @@ During your development with NestJS, you may encounter various errors as you lea

### Cannot find module 'typescript'

For now, anyone who has this issue has two options:
This is not likely to be encountered but anyone who has this issue has two options as a quick fix:

- Add typescript to dependencies in your package.json and run a project
- Comment out (or remove) `__exportStar(require("./typescript"), exports);` in `node_modules/nestjs-i18n/dist/utils/index.js`

### translating nested translations without arguments
```json
// translations.json
{
"nestedValue": "world",
"foo": "Hello $t(translations.nestedValue)"
}
```
```ts
// foo.service.ts
i18n.translate("translations.foo") // result: "Hello $t(translations.nestedValue)"

// to get the actual translations , just pass in empty args
i18n.translate("translations.foo", { args: {} }) // result: "Hello world"
```

0 comments on commit 8a46b18

Please sign in to comment.