Skip to content

Invalid i18n configuration: Locales 'ru' and 'en' cannot have the same subPath: ''. #29398

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

Closed
1 task done
zip-fa opened this issue Jan 19, 2025 · 3 comments · Fixed by #29422
Closed
1 task done

Invalid i18n configuration: Locales 'ru' and 'en' cannot have the same subPath: ''. #29398

zip-fa opened this issue Jan 19, 2025 · 3 comments · Fixed by #29422

Comments

@zip-fa
Copy link

zip-fa commented Jan 19, 2025

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Hey.
With v19.1 it's not possible to build with this config:

"sourceLocale": {
      "code": "ru",
      "subPath": ""
    },
    "locales": {
      "en": {
        "translation": "apps/frontend/src/locale/messages.en.xlf",
        "subPath": ""
      }
    },
"configurations": {
        "production-en": {
          "localize": ["en"]
        },
        "production": {
          "localize": ["ru"],
}

How about moving non-unique subPath check inside build configuration, but not global?

This should fail:

"configurations": {
 "production": {
          "localize": ["ru", "en"],
}
}

This should not:

"configurations": {
 "production": {
          "localize": ["ru"],
}
}

Minimal Reproduction

ng build

Exception or Error


Your Environment

v19.1

Anything else relevant?

No response

@burner-account
Copy link

burner-account commented Jan 19, 2025

I personally used baseHref="" for i18n versions of my app that each will be deployed to the / of their own subdomain.

I failed to get this to work with "subPath", is there a documented new way on how to have different languages on a different root paths?

@zip-fa
Copy link
Author

zip-fa commented Jan 19, 2025

You can make separate angular.json files and rename them before build in your CI, but let's wait for the official response

@alan-agius4 alan-agius4 self-assigned this Jan 20, 2025
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 20, 2025
…te `subPaths` with inlined locales

The i18n configuration validation was incorrectly flagging errors for identical `subPaths` when both locales were not inlined within the same build. This was due to the validation not properly accounting for the inlining of locales.

This commit fixes this issue by ensuring that the validation only checks for duplicate `subPaths` when the locales are inlined.

Closes angular#29396 and closes angular#29398
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 20, 2025
…te `subPaths` with inlined locales

The i18n configuration validation was incorrectly flagging errors for identical `subPaths` when both locales were not inlined within the same build. This was due to the validation not properly accounting for the inlining of locales.

This commit fixes this issue by ensuring that the validation only checks for duplicate `subPaths` when the locales are inlined.

Closes angular#29396 and closes angular#29398
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 21, 2025
…te `subPaths` with inlined locales

The i18n configuration validation was incorrectly flagging errors for identical `subPaths` when both locales were not inlined within the same build. This was due to the validation not properly accounting for the inlining of locales.

This commit fixes this issue by ensuring that the validation only checks for duplicate `subPaths` when the locales are inlined.

Closes angular#29398
alan-agius4 added a commit that referenced this issue Jan 21, 2025
…te `subPaths` with inlined locales

The i18n configuration validation was incorrectly flagging errors for identical `subPaths` when both locales were not inlined within the same build. This was due to the validation not properly accounting for the inlining of locales.

This commit fixes this issue by ensuring that the validation only checks for duplicate `subPaths` when the locales are inlined.

Closes #29398

(cherry picked from commit 334ec0f)
@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 Feb 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants