Skip to content

Loading all entries from json file as object #405

Answered by toonvanstrijp
Pawel2505 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Pawel2505 this is possible indeed and exactly how it supposed to work.

import { Controller, Get } from '@nestjs/common';
import { I18n, I18nContext } from 'nestjs-i18n';

@Controller()
export class AppController {
  @Get()
  async getHello(@I18n() i18n: I18nContext) {
    return await i18n.t('test');
  }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Pawel2505
Comment options

Answer selected by Pawel2505
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants