Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong html lang with ng serve #18094

Closed
1 of 15 tasks
TinyMan opened this issue Jul 1, 2020 · 3 comments · Fixed by #19090
Closed
1 of 15 tasks

Wrong html lang with ng serve #18094

TinyMan opened this issue Jul 1, 2020 · 3 comments · Fixed by #19090

Comments

@TinyMan
Copy link
Contributor

TinyMan commented Jul 1, 2020

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

no

Description

A clear and concise description of the problem...

When using ng serve, the html lang attribute is not set to the correct locale.

🔬 Minimal Reproduction

https://github.com/TinyMan/serve-wrong-locale-id

ng serve -c fr
We can see in browser that the html starts with :

<!doctype html>
<html lang="en">

🔥 Exception or Error

🌍 Your Environment





     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 10.0.0
Node: 12.18.1
OS: win32 x64

Angular: 10.0.1
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.1000.0
@angular-devkit/build-angular     0.1000.0
@angular-devkit/build-optimizer   0.1000.0
@angular-devkit/build-webpack     0.1000.0
@angular-devkit/core              10.0.0
@angular-devkit/schematics        10.0.0
@angular/cli                      10.0.0
@ngtools/webpack                  10.0.0
@schematics/angular               10.0.0
@schematics/update                0.1000.0
rxjs                              6.5.5
typescript                        3.9.5
webpack                           4.43.0

Anything else relevant?

@r-shakeri
Copy link

is there any future plan to fix this issue?

@pburkindine
Copy link

Upvote, we have css selectors based on the lang attribute so this is an important regression for us, we are working around it with an app initializer

clydin added a commit to clydin/angular-cli that referenced this issue Oct 15, 2020
When using the non-deprecated localization options, the development server was not properly setting the HTML `lang` attribute for the application.  This change ensures that the active locale is used within the application's index HTML file.

Closes angular#18094
alan-agius4 pushed a commit that referenced this issue Oct 15, 2020
When using the non-deprecated localization options, the development server was not properly setting the HTML `lang` attribute for the application.  This change ensures that the active locale is used within the application's index HTML file.

Closes #18094
alan-agius4 pushed a commit that referenced this issue Oct 15, 2020
When using the non-deprecated localization options, the development server was not properly setting the HTML `lang` attribute for the application.  This change ensures that the active locale is used within the application's index HTML file.

Closes #18094

(cherry picked from commit 58a7dea)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants