Skip to content

Commit

Permalink
ajuste geral
Browse files Browse the repository at this point in the history
  • Loading branch information
renanarosario committed Jan 8, 2025
1 parent 4f64baa commit ae9ee51
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
* @usedBy PoI18nModule
*/
export interface PoI18nConfigContext {
[name: string]: { [language: string]: { [literal: string]: string } } | { url: string };
[name: string]: { [language: string]: { [literal: string]: string } } | { url: string };
}
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ describe('PoI18nService:', () => {
describe('getLiteralsFromContextService', () => {
it(`should call 'observer.next' with translations if translations keys length is greater than 0
and call 'getLiteralsLocalStorageAndCache'`, () => {
const observer = { next: val => { } };
const observer = { next: val => {} };
const translations = { car: 'Carro', people: 'Pessoas' };

const spyGetLiteralsLocalStorageAndCache = spyOn(service, <any>'getLiteralsLocalStorageAndCache');
Expand All @@ -396,7 +396,7 @@ describe('PoI18nService:', () => {

it(`shouldn't call 'observer.next' with translations if translations keys length is 0
and call 'getLiteralsLocalStorageAndCache'`, () => {
const observer = { next: val => { } };
const observer = { next: val => {} };

const spyGetLiteralsLocalStorageAndCache = spyOn(service, <any>'getLiteralsLocalStorageAndCache');
const spyMergeObject = spyOn(service, <any>'mergeObject').and.returnValue({});
Expand All @@ -413,7 +413,7 @@ describe('PoI18nService:', () => {
describe('getLiteralsLocalStorageAndCache', () => {
it(`should call 'searchInLocalStorage' and call 'observer.next' with
mergedObject if 'useCache' is true`, fakeAsync(() => {
const observer = { next: val => { } };
const observer = { next: val => {} };

const translations = { car: 'Car' };
const storageTranslations = { soccer: 'Soccer' };
Expand All @@ -437,7 +437,7 @@ describe('PoI18nService:', () => {

it(`should call 'searchInLocalStorage' and not call 'observer.next' with
mergedObject if 'useCache' is true and localstorage is empty`, fakeAsync(() => {
const observer = { next: val => { } };
const observer = { next: val => {} };

const translations = { car: 'Car' };

Expand All @@ -458,7 +458,7 @@ describe('PoI18nService:', () => {

it(`should call 'getHttpService' and call 'observer.next' with
mergedObject from returned translations with current translation`, fakeAsync(() => {
const observer = { next: val => { } };
const observer = { next: val => {} };

const translations = { car: 'Car' };
const translationsService = { people: 'People' };
Expand All @@ -477,7 +477,7 @@ describe('PoI18nService:', () => {
}));

it(`should search for literals in portuguese if not all literals was found`, fakeAsync(() => {
const observer = { next: val => { } };
const observer = { next: val => {} };

const translations = { car: 'Car' };
const translationsService = { people: 'People' };
Expand Down Expand Up @@ -506,7 +506,7 @@ describe('PoI18nService:', () => {
}));

it(`should search for literals in portuguese if not all literals was found and languageAlternative is undefined`, fakeAsync(() => {
const observer = { next: val => { } };
const observer = { next: val => {} };

const translations = { car: 'Car' };
const translationsService = { people: 'People' };
Expand Down
1 change: 0 additions & 1 deletion projects/ui/src/lib/services/po-i18n/po-i18n.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,3 @@ export function initializeLanguageDefault(configs: Array<PoI18nConfig>, language
};
return setDefaultLanguage;
}

4 changes: 1 addition & 3 deletions projects/ui/src/lib/services/po-i18n/po-i18n.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { PoI18nConfig } from './interfaces/po-i18n-config.interface';
*/

@Injectable({ providedIn: 'root' })
export class PoI18nService extends PoI18nBaseService { }
export class PoI18nService extends PoI18nBaseService {}

// Função usada para retornar instância para o módulo po-i18n.module
export function returnPoI18nService(
Expand All @@ -27,7 +27,5 @@ export function returnPoI18nService(
}));
const mergedConfig = deepmergeAll<PoI18nConfig>(validatedConfigs);

console.log('Configurações Mescladas:', mergedConfig);

return new PoI18nService(mergedConfig, http, languageService);
}

0 comments on commit ae9ee51

Please sign in to comment.