Removed @locl dependency for translations

Added CommonModule to fix intellisense

Added ability to load json assets by name, and an http call to update youtubedl-material
This commit is contained in:
Isaac Grynsztein
2020-04-01 19:44:22 -04:00
parent c40513ba4a
commit 458e4b45f8
4 changed files with 13 additions and 9 deletions

View File

@@ -6,7 +6,6 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { environment } from './environments/environment';
import { loadTranslations } from '@angular/localize';
import { getTranslations, ParsedTranslationBundle } from '@locl/core';
if (environment.production) {
enableProdMode();
@@ -17,8 +16,7 @@ if (!locale) {
localStorage.setItem('locale', 'en');
}
if (locale && locale !== 'en') {
getTranslations(`./assets/i18n/messages.${locale}.json`).then(
(data: ParsedTranslationBundle) => {
fetch(`./assets/i18n/messages.${locale}.json`).then(res => res.json()).then((data) => {
loadTranslations(data as any);
import('./app/app.module').then(module => {
platformBrowserDynamic()