import { registerLocaleData } from '@angular/common';

// import and register locale manually
import localeEn from '@angular/common/locales/en';
import localeEN_150 from '@angular/common/locales/en-150';
import localeEN_AT from '@angular/common/locales/en-AT';
import localeEN_BE from '@angular/common/locales/en-BE';
import localeEN_CH from '@angular/common/locales/en-CH';
import localeEN_CY from '@angular/common/locales/en-CY';
import localeEN_DE from '@angular/common/locales/en-DE';
import localeEN_DK from '@angular/common/locales/en-DK';
import localeEN_FI from '@angular/common/locales/en-FI';
import localeEN_GG from '@angular/common/locales/en-GG';
import localeEN_GI from '@angular/common/locales/en-GI';
import localeEN_IE from '@angular/common/locales/en-IE';
import localeEN_IM from '@angular/common/locales/en-IM';
import localeEN_JE from '@angular/common/locales/en-JE';
import localeEN_MT from '@angular/common/locales/en-MT';
import localeEN_NL from '@angular/common/locales/en-NL';
import localeEN_SE from '@angular/common/locales/en-SE';
import localeEN_SI from '@angular/common/locales/en-SI';
import localeEnExtra from '@angular/common/locales/extra/en';
import localeEnExtra_150 from '@angular/common/locales/extra/en-150';
import localeEnExtra_AT from '@angular/common/locales/extra/en-AT';
import localeEnExtra_BE from '@angular/common/locales/extra/en-BE';
import localeEnExtra_CH from '@angular/common/locales/extra/en-CH';
import localeEnExtra_CY from '@angular/common/locales/extra/en-CY';
import localeEnExtra_DE from '@angular/common/locales/extra/en-DE';
import localeEnExtra_DK from '@angular/common/locales/extra/en-DK';
import localeEnExtra_FI from '@angular/common/locales/extra/en-FI';
import localeEnExtra_GG from '@angular/common/locales/extra/en-GG';
import localeEnExtra_GI from '@angular/common/locales/extra/en-GI';
import localeEnExtra_IE from '@angular/common/locales/extra/en-IE';
import localeEnExtra_IM from '@angular/common/locales/extra/en-IM';
import localeEnExtra_JE from '@angular/common/locales/extra/en-JE';
import localeEnExtra_MT from '@angular/common/locales/extra/en-MT';
import localeEnExtra_NL from '@angular/common/locales/extra/en-NL';
import localeEnExtra_SE from '@angular/common/locales/extra/en-SE';
import localeEnExtra_SI from '@angular/common/locales/extra/en-SI';
import localeFr from '@angular/common/locales/fr';
import localeFR_MC from '@angular/common/locales/fr-MC';
import localeFR_LU from '@angular/common/locales/fr-LU';
import localeFR_CH from '@angular/common/locales/fr-CH';
import localeFR_BE from '@angular/common/locales/fr-BE';
import localeFRExtra_BE from '@angular/common/locales/extra/fr-BE';
import localeFRExtra_CH from '@angular/common/locales/extra/fr-CH';
import localeFRExtra_LU from '@angular/common/locales/extra/fr-LU';
import localeFRExtra_MC from '@angular/common/locales/extra/fr-MC';
import localeFrExtra from '@angular/common/locales/extra/fr';

import { GlobalConfig, I18nConfig, LocaleServiceConfig } from '@eui/core';

/**
 * import and register locales (currently MWP uses only French and English)
 */
registerLocaleData(localeEn, localeEnExtra);
registerLocaleData(localeFr, localeFrExtra);
registerLocaleData(localeEN_150, localeEnExtra_150);
registerLocaleData(localeEN_AT, localeEnExtra_AT);
registerLocaleData(localeEN_BE, localeEnExtra_BE);
registerLocaleData(localeEN_CH, localeEnExtra_CH);
registerLocaleData(localeEN_CY, localeEnExtra_CY);
registerLocaleData(localeEN_DE, localeEnExtra_DE);
registerLocaleData(localeEN_DK, localeEnExtra_DK);
registerLocaleData(localeEN_FI, localeEnExtra_FI);
registerLocaleData(localeEN_GG, localeEnExtra_GG);
registerLocaleData(localeEN_GI, localeEnExtra_GI);
registerLocaleData(localeEN_IE, localeEnExtra_IE);
registerLocaleData(localeEN_IM, localeEnExtra_IM);
registerLocaleData(localeEN_JE, localeEnExtra_JE);
registerLocaleData(localeEN_MT, localeEnExtra_MT);
registerLocaleData(localeEN_NL, localeEnExtra_NL);
registerLocaleData(localeEN_SE, localeEnExtra_SE);
registerLocaleData(localeEN_SI, localeEnExtra_SI);
registerLocaleData(localeFR_MC, localeFRExtra_MC);
registerLocaleData(localeFR_LU, localeFRExtra_LU);
registerLocaleData(localeFR_CH, localeFRExtra_CH);
registerLocaleData(localeFR_BE, localeFRExtra_BE);

/**
 * Internationalization Configuration
 */
const i18nConfig: I18nConfig = {
    i18nLoader: {
        i18nFolders: ['elements/@remote.name@/bundles/assets/i18n-compiled'],
    },
    i18nService: {
        languages: ['en', 'fr'],
        defaultLanguage: 'en',
    },
};

/**
 * Locale Configuration
 */
const localeConfig: LocaleServiceConfig = {
    id: 'en',
    available: ['en', 'fr'],
    bindWithTranslate: true,
    affectGlobalLocale: true,
};

/**
 * Global Configuration
 */
export const GLOBAL: GlobalConfig = {
    /* URL that needs to be used in the appRouting of the MWP */
    baseUrl: '@base.url@',
    // EXTRA_URLS_CONFIG_PLACEHOLDER
    /* Element tag name that needs to be unique - make sure it doesn't collide with any other MWP element */
    elementName: '@element.name@',
    /* in case you are using NgRx give it a unique name (mostly for debugging) */
    storeName: '@store.name@',
    i18n: i18nConfig,
    locale: localeConfig,
    eui: {
        assetsBaseUrl: 'assets/elements/@remote.name@/bundles/assets',
    },
};
