0

I tring to use translate the text inside my renderd html But only the glitch text appear inside it I make translate module inside server module But only global components like navbar was translated

Any help !?

1 Answer 1

1

i fix it my usign custom loader get the translate from asstest by import json

custom Json loader

import { Observable, of } from "rxjs";


import { TranslateLoader } from "@ngx-translate/core";


export class JSONModuleLoader implements TranslateLoader {
TRANSLATIONS: {
    ar: any,
    en: any
}
constructor(TRANSLATIONS: any) {
    this.TRANSLATIONS = TRANSLATIONS
}
getTranslation(lang: string): Observable<any> {
    return of(this.TRANSLATIONS[lang]);
}
}

my module factory

import { JSONModuleLoader } from './translate/translateLoader';
import { AppTAr, AppTEn } from '../environments/translat';
let TRANSLATIONS = {
  ar: AppTAr,
  en: AppTEn
}
export function createTranslateLoader() {
  return new JSONModuleLoader(TRANSLATIONS);
}

and it's work now :"D

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.