projects/congarevenuecloud/ecommerce/src/lib/services/translator-loader.service.ts
This service is a work in progress This service is responsible for providing language translations for static text/labels in the application, based on user locale. If a user does not have a specified locale, translations will be determined based on the 'defaultLanguage' configured in the environment file.
import { TranslatorLoaderService } from '@congarevenuecloud/ecommerce';
constructor(private translateService: TranslatorLoaderService) {}
// or
export class MyService extends AObjectService {
private translateService: TranslatorLoaderService = this.injector.get(TranslatorLoaderService);
}
Methods |
constructor(apiService: ApiService, storefrontService: StorefrontService, httpClient: HttpClient, configService: ConfigurationService)
|
|||||||||||||||
Parameters :
|
getTranslation | ||||||||
getTranslation(locale: string)
|
||||||||
Retrieves translated labels based on current user's locale. Example:Example :
Parameters :
Returns :
Observable<object>
an Observable containing the json string with translations. |