Base solution for your next web application
Open Closed

Localization in angular index.html #10824


User avatar
0
najeebalmajeedy created

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? 10.5.0
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .net core

If issue related with ABP Framework

  • What is ABP Framework version? No

If issue is about UI

  • Which theme are you using? Default
  • What are the theme settings? Default

What is the best practice to localize layout title and keywords? As you can see, all text is hardcoded in index.html `

    <meta property="og:title" content="Fu" />
    <meta property="og:image" content="" />
    <meta property="og:description" content="keywords" />
    <meta property="og:url" content="" />

    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="author" content="" />
    <meta name="description" content="" />
</head>

`


2 Answer(s)
  • User Avatar
    0
    musa.demir created

    Hi @najeebalmajeedy

    Here is the documentation about it.https://angular.io/guide/set-document-title

    import {Title} from "@angular/platform-browser";
    ....
    constructor(private titleService:Title) {
      this.titleService.setTitle(this.l('YOURTITLE'));
    }
    
  • User Avatar
    0
    najeebalmajeedy created

    It worked. Thank you musa.demir.