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

Schema validation failed with the following errors: Data path "" must NOT have additional properties(i18nFile). #38

Open
rw6bsc opened this issue Jan 28, 2022 · 1 comment

Comments

@rw6bsc
Copy link

rw6bsc commented Jan 28, 2022

Hello,

I followed the guide on internationalization and I'm sad to inform you, that it is outdated.
You already updated this repo to angular v13, but the i18n fields in the angular.json don't work anymore since v11.
I tested out your current master, then I also tested out some older commits to find out why it doesn't work.

When you run "ng build -c fr" it fails with the error:
Schema validation failed with the following errors: Data path "" must NOT have additional properties(i18nFile).

Then I tested the same command with commit "77a89a4226cc90e55dd1a8352f2e237b3e78d1b9" labeled "upgrade to angular 12" and I got the same result.

Commit: "88288b6f03384ff1ef916c5310cdd58609908f48" labeled "upgrade to Angular 11 and Node 14" worked, but it told me:

Option "i18nFile" is deprecated: Use 'locales' object in the project metadata instead.
Option "i18nLocale" is deprecated: Use 'localize' instead.

At the start when I was building the fr configuration.

Commit: "ec06a6131bd1c37a95d797002727d7ce6a502a6d" labeled "upgrade to angular 10" also worked, but without warning.

The way Angular handles i18n now is actually through adding locales to the workspace. It is very confusing to me at the moment, so I sadly can't point you to resources that will help you update your course.

@rw6bsc
Copy link
Author

rw6bsc commented Jan 28, 2022

I made the current master (fd09f95) work. I don't know if this is now the expected solution, but here is how I did it:

In Angular.json:

  1. delete lines:
    "i18nFile": "src/locale/messages.fr.xlf", "i18nLocale": "fr",
  2. insert:
    "localize": ["fr"],
    instead.

Then "ng serve -c fr" works and the translations are available.

The "fr" config should look like this then:
"fr": { "budgets": [ { "type": "anyComponentStyle", "maximumWarning": "6kb" } ], "outputPath": "dist/angular-course-fr/", "localize": ["fr"], "i18nMissingTranslation": "ignore" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant