Skip to content

--lang option lacks error handling in 6.8.0-beta #10828

Open

Description

@kategengler

https://rfcs.emberjs.com/id/0635-ember-new-lang

The --lang option to ember new in 6.8.0-beta.3 does not error handle the lang attribute. Incorrect lang codes are silently ignored.

Activity

  1. mansona commented on Oct 6, 2025

    @mansona
    Member
  2. changed the title [-]`--lang` option does noting in 6.8.0-beta[/-] [+]`--lang` option lacks error handling in 6.8.0-beta[/+] on Oct 6, 2025
  3. NullVoxPopuli commented on Oct 6, 2025

    @NullVoxPopuli
    Contributor

    We've lost all the error handling.

    ???? explain?

  4. kategengler commented on Oct 6, 2025

    @kategengler
    MemberAuthor

    I linked the description of the behavior in the RFC and the utility that does the checking. The RFC calls out a particular package for error handling of the language codes and also that we check against misunderstanding for programmatic languages (someone thinking --lang TS for example).

  5. mansona commented on Oct 6, 2025

    @mansona
    Member

    This 100% works exactly as it did before. There is no change in this behaviour, just a change in the file that it affects.

    I opened a PR to confirm it and you can see in CI all the --lang related tests pass https://github.com/ember-cli/ember-cli/actions/runs/18292893934/job/52084296264?pr=10830#step:4:126

  6. kategengler commented on Oct 6, 2025

    @kategengler
    MemberAuthor

    I''ll re-verify but when I did --lang ita to the beta, I did not see a warning. When I do it to 6.8.0, I do.

    I also don't think this is a blocker for ready for release for vite though (it not working at all would have been imo).

  7. bertdeblock commented on Oct 7, 2025

    @bertdeblock
    Member

    An invalid lang code should normally display a warning, it should not error. Was decided here.
    The placement of the warning is unfortunate, i.e. you might not see it because it is displayed before the list of generated files, so you might have to scroll upwards again.

    Example:

    WARNING: An issue with the `--lang` flag returned the following message:
      Unrecognised language subtag, "ita".`
    WARNING: The human language of the application will NOT be set in
      the `<html>` element's `lang` attribute in `index.html`.
    If this was not your intention, you may edit the `<html>` element's
      `lang` attribute in `index.html` manually after the process is complete.
    Information about using the `--lang` flag:
      The `--lang` flag sets the base human language of an app or test app:
        - `app/index.html` (app)
        - `tests/dummy/app/index.html` (addon test app)
      If used, the lang option must specfify a valid language code.
      For default behavior, remove the flag.
      See `ember <command> help` for more information.
    installing app-blueprint
    ✨  Creating a new Ember app in /home/bert/Code/temp/foo/foo:
      create .editorconfig
      create .ember-cli
      create .env.development
      create .github/workflows/ci.yml
      create .prettierignore
      create .prettierrc.mjs
      create .stylelintignore
      create .stylelintrc.cjs
      create .template-lintrc.mjs
      create .watchmanconfig
      create README.md
      create /home/bert/Code/temp/foo/foo/babel.config.cjs
      create /home/bert/Code/temp/foo/foo/eslint.config.mjs
      create app/app.js
      create app/components/.gitkeep
      create app/config/environment.js
      create app/controllers/.gitkeep
      create app/deprecation-workflow.js
      create app/helpers/.gitkeep
      create app/models/.gitkeep
      create app/router.js
      create app/routes/.gitkeep
      create app/styles/app.css
      create /home/bert/Code/temp/foo/foo/app/templates/application.gjs
      create config/ember-cli-update.json
      create config/environment.js
      create config/optional-features.json
      create config/targets.js
      create ember-cli-build.js
      create .gitignore
      create index.html
      create package.json
      create public/robots.txt
      create testem.cjs
      create tests/helpers/index.js
      create tests/index.html
      create tests/integration/.gitkeep
      create tests/test-helper.js
      create tests/unit/.gitkeep
      create vite.config.mjs
    
    🎉  Successfully created project foo.
    👉  Get started by typing:
    
      $ cd foo
      $ npm start
    
    Happy coding!
  8. kategengler commented on Oct 7, 2025

    @kategengler
    MemberAuthor

    Yeah I know it can get lost in the output ... but I was directly comparing 6.7 and the 6.8 beta side-by-side. I'll try to recreate again at a later point but I don't think this is a blocker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions