X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fapp.module.ts;h=14fdb7588b9a3996e6e7b7fe090ca65f25379c7d;hb=361dcebc75dea74947b6c3aafd9d7d720c054b01;hp=dda705811fb8bc8b8867081ad37b6f94139a0dd9;hpb=ba430d7516bc5b1324b60571ba7594460969b7fb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts index dda705811..14fdb7588 100644 --- a/client/src/app/app.module.ts +++ b/client/src/app/app.module.ts @@ -4,7 +4,6 @@ import { ServerService } from '@app/core' import { ResetPasswordModule } from '@app/reset-password' import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core' -import { ClipboardModule } from 'ngx-clipboard' import 'focus-visible' import { AppRoutingModule } from './app-routing.module' @@ -15,11 +14,10 @@ import { LoginModule } from './login' import { AvatarNotificationComponent, LanguageChooserComponent, MenuComponent } from './menu' import { SharedModule } from './shared' import { VideosModule } from './videos' -import { buildFileLocale, getCompleteLocale, isDefaultLocale } from '../../../shared/models/i18n' -import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils' import { SearchModule } from '@app/search' import { WelcomeModalComponent } from '@app/modal/welcome-modal.component' import { InstanceConfigWarningModalComponent } from '@app/modal/instance-config-warning-modal.component' +import { buildFileLocale, getCompleteLocale, isDefaultLocale } from '@shared/models' export function metaFactory (serverService: ServerService): MetaLoader { return new MetaStaticLoader({ @@ -48,8 +46,6 @@ export function metaFactory (serverService: ServerService): MetaLoader { ], imports: [ BrowserModule, - // FIXME: https://github.com/maxisam/ngx-clipboard/issues/133 - ClipboardModule, CoreModule, SharedModule, @@ -69,17 +65,12 @@ export function metaFactory (serverService: ServerService): MetaLoader { AppRoutingModule // Put it after all the module because it has the 404 route ], + providers: [ { provide: TRANSLATIONS, useFactory: (locale: string) => { - // On dev mode, test localization - if (isOnDevLocale()) { - locale = buildFileLocale(getDevLocale()) - return require(`raw-loader!../locale/angular.${locale}.xlf`) - } - - // Default locale, nothing to translate + // Default locale, nothing to translate const completeLocale = getCompleteLocale(locale) if (isDefaultLocale(completeLocale)) return ''