> For the complete documentation index, see [llms.txt](https://guilhermesantos.gitbook.io/niro-health/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guilhermesantos.gitbook.io/niro-health/locale-i18n/inject-service.md).

# Inject Service

There are situations where you will need to translate your texts within the `service`.

{% code title="src/core/locales/en.json" %}

```json
{
  "hello": "Hello World"
}
```

{% endcode %}

```typescript
import { Injectable } from '@nestjs/common';
import { LocaleService } from '@/core/i18n/i18n.service';

@Injectable()
export class AppService {
  constructor(private readonly localeService: LocaleService) {}
  
  getHello(): string {
    return this.localeService.translate('hello');
  } // output: Hello World
}
```

> Simply you can inject the `service` from `locale` and translate your texts.
