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.
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
Use ILocalizationService instead of get all cultures #14934
Use ILocalizationService instead of get all cultures #14934
Changes from 2 commits
1ccaf6b
a86135d
b55e056
6c12fc1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check failure on line 72 in src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/Controllers/AdminController.cs
GitHub Actions / Build & Test (ubuntu-latest)
Check failure on line 72 in src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/Controllers/AdminController.cs
GitHub Actions / Build & Test (ubuntu-latest)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebastienros I'm not sure this is appropriate to list only supported cultures. This means that now the ElasticSearch indices culture can only be supported cultures that are added in the Admin UI. This means that I need to add translations to each of these supported cultures while I could have been able to loosely couple a culture with an index before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an example of that I could have a website that is majorly written in french but has some content in english which I would want to index in a different indice if required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How this different from getting all cultures?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They come from the framework instead of the DB. And the ASP.Net localization middleware will support these cultures if they are added. if you just list cultures that are in the framework ; it doesn't do anything else than that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I knew what you mentioned :)
What I mean how the change that I made is different for the Elastic search module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Different in what matter? I'm just saying that we should not use supported cultures only for this and also Lucene or any other Search index configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frankly, I didn't understand why using the supported cultures in this case is not preferred!! maybe @sebastienros understands what you are referring to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could have a website that is majorly written in english. You would have only "en" as a supported culture.
But your website has content written in french for a specific content type... then you would not want to support "fr" but only index that content type for the "fr" culture in a custom IndexingHandler...
Now, I understand that what you expect is to see the same cultures as the ones that are supported in these index settings but it is not everyone that uses OC that way. This is limiting options for people that have custom handlers.
And now I need to support all the cultures which means that I need to do custom code to remove these supported cultures from the LocalizationMiddleware.