-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
translations: add http translations support #183
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally with both other PRs
// mock response after the xhr request, otherwise it will be undefined | ||
http.expectOne('/assets/i18n/fr.json').flush({ | ||
search: 'Recherche avancée', | ||
'does not exists': 'Existe pas' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A detail but: "N'existe pas" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a problem with simple quote. I will change 'does not exists' => 'not exists'
|
||
// new translations | ||
translate.get('does not exists').subscribe((res: string) => { | ||
expect(res).toEqual('Existe pas'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 excellent!
import { TranslateLoader as BaseTranslateLoader } from '@ngx-translate/core'; | ||
import { Observable, of } from 'rxjs'; | ||
import { Observable, of, forkJoin } from 'rxjs'; | ||
import { CoreConfigService } from '../core-config.service.js'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { catchError, map } from 'rxjs/operators'; | ||
import de from './i18n/de.json'; | ||
import en from './i18n/en.json'; | ||
import fr from './i18n/fr.json'; | ||
import it from './i18n/it.json'; | ||
import { Inject } from '@angular/core'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just sort imports
* Removes `customTranslations` property. * Adds `translationsURLs` to provide a list of remote translations. * Changes the demo applications accordingly. * Simplifies the tests. Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch> Co-Authored-by: Sébastien Délèze <sebastien.deleze@rero.ch>
customTranslations
property.translationsURLs
to provide a list of remote translations.Co-Authored-by: Johnny Mariéthoz Johnny.Mariethoz@rero.ch
Used by:
Why are you opening this PR?
How to test?
Code review check list