Use channel default locale as main localization to generate url #197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @stefandoorn! IMHO using the LocaleContext in a CLI context is not always a good choice. It will pick the locale code from the default locale parameter.
Our use case is with two channels with respectively one locale different from the other. So, the generate command creates without problems the sitemap for the channel that has the same locale of the locale parameter, but it throws errors for the other Channel. The error is due to the missing of the slug in the default locale that is used as the main localization!
So, this PR will use the Channel's default Locale as the main localization. The LocaleContext is now only a "fallback" if it is not set.