Transloco is an open-source internationalisation and localisation library for Angular and a set of accompanying tools for translations management. It's main features are: switching languages at runtime, lazy-loading support and Ivy compatibility.
Questions tagged [transloco]
55 questions
1
vote
1 answer
How to convert Observable to other Observable
I would like to use Transloco and gather translations from existing REST API and not from the i18n file. I replaced line in TranslocoHttpLoader by rest service call:
getTranslation(lang: string): Observable {
// return…

sasynkamil
- 859
- 2
- 12
- 23
1
vote
0 answers
Transloco - Is there a way to reference other translations within a plural rule?
We are using plural rules in the JSON in our app, such as:
"myPluralRule": "{myCount, plural, =0 {no results} one {1 result} other {# results}}"
However, we need to translate these into 27 other languages and, although we've tried to explain…

Andrew Bateman
- 11
- 1
1
vote
1 answer
TranslocoLocale pipes injected into a service causes unit test errors
How can I test a service that uses TranslocoLocale pipes (TranslocoDecimalPipe, TranslocoDatePipe, etc.)? I could obviously mock the pipes myself but I shouldn't have to.
TranslocoLocale pipes in my component templates work correctly in unit…

Brino
- 2,442
- 1
- 21
- 36
1
vote
2 answers
Angular ngFor on an array loaded via Transloco
I'm using Transloco to manage multiple language in an angular10 project.
I created a json i18n file like this:
"Datalist":[
{
"from" : "value",
"Content" : "data"
},
{
"from" : "value",
"Content" :…

SamWarry
- 11
- 2
1
vote
0 answers
How to get scoped values in the Transloco Translate API
I am trying to find the syntax for getting translation values from a scoped object.
I would like to get the translation text for the key "title".
file: en.json
{
"foo": "Foo",
"bar": "Bar",
"dashboard": {
"title": "Dashboard Title",
…

Martin Andersen
- 2,460
- 2
- 38
- 66
1
vote
1 answer
How to correctly unit test labels coming from transloco api in angular
I have been using Transloco API for a time but I have not been able to use it during unit testing.
I am following this blog from ngneat Unit testing with transloco
But my simple test cases are also failing due to some reason with below error:
Chrome…

Deep
- 929
- 2
- 16
- 32
0
votes
1 answer
Firebase deploy error: "No i18n config on project."
To deploy my Angular project I ran ng build --configuration production and then firebase deploy --only hosting. It says:
Thank you for trying our early preview of Angular support on Firebase Hosting.
During the preview, support is best-effort and…

Thomas David Kehoe
- 10,040
- 14
- 61
- 100
0
votes
1 answer
@nguniversal/express-engine always build environment dev
I used @nguniversal/express-engine and @ngneat/transloco, but when i build with command: npm run build:ssr then always build link dev: localhost:4200.
This is function in transloco-root.module.ts always build with link dev:
getTranslation(lang:…

Lê Duy Thứ
- 61
- 5
0
votes
0 answers
How can I dynamically add marked words in Transloco for translations like in i18n?
Is there a way to move dynamically the marked words to be translated in transloco ?
I mean like i18n, all the words with i18n should be added dynamically in the translation file, i would like to see if there is a way to attend the same in transloco…

Don Delice Dushime
- 11
- 5
0
votes
0 answers
Load JSON files from dependency offline in mobile
I have the following scenario.
I have a custom translations library which serves to many angular applications.
Its a wrapper built around Transloco, which also has all my JSON files which have the translations
One of the consuming apps is a web…

Pato
- 189
- 1
- 9
0
votes
1 answer
Angular TRANSLOCO library change currency symbol
I am going through the Angular Transloco library https://ngneat.github.io/transloco/, I have successfully installed and tried the examples https://ngneat.github.io/transloco/docs/plugins/locale/ all worked as expected. For example
{{…

fanbondi
- 1,035
- 5
- 18
- 37
0
votes
1 answer
Error when migrating from angular 15 to angular 16 when adding provideClientHydration
After migrating from angular 15 to angular 16, using universal, if I add provideClientHydration to my AppModule I get the error
ERROR Error: When using the default fallback, a fallback language must be provided in the config!
at getNextLangs…

Conde
- 785
- 15
- 31
0
votes
1 answer
Handle Angular monorepo with Transloco
We use a Angular v15 monorepo that contains several applications and libraries. The monorepo and applications are created using the directions from the Angular CLI documentations. The libraries are Angular modules that can be imported in other…

Kees de Bruin
- 175
- 2
- 16
0
votes
0 answers
How can I internationalize a Website written in Angular?
I need a little help. I'm working on a Website. On this Website, there are Areas with a large amount of text. For example, a story. How can I Internationalize this?
For small texts, like a navigation, I can use modules like transloco. But in my…

user39063
- 183
- 1
- 13
0
votes
0 answers
Is using transloco 't' function from the directive calling the function every time on change detection happens in Angular?
I was wondering about this issue about the "t" function transloco uses in its directive.
When we use functions in our template in angular for, lets say, showing users email. So we write something like:
{{getUserEmail()}}
From my…
zvocs
- 1
- 2