Skip to content

#6793: Adding a content-independent culture selector shape for the front-end#8784

Merged
BenedekFarkas merged 13 commits into
OrchardCMS:1.10.xfrom
Lombiq:issue/6793
Apr 18, 2024
Merged

#6793: Adding a content-independent culture selector shape for the front-end#8784
BenedekFarkas merged 13 commits into
OrchardCMS:1.10.xfrom
Lombiq:issue/6793

Conversation

@BenedekFarkas

Copy link
Copy Markdown
Member

Fixes #6793

Originally developed by Sergio from XK Project.

Comment thread src/Orchard/Utility/Extensions/NameValueCollectionExtensions.cs

ILocalizableAspect localizationPart = null, siteCultureLocalizationPart = null;
foreach (LocalizationPart l in localizations) {
if (l.Culture.Culture == cultureName) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are currently normalizing these in OC, should it compare with ignore case?

@BenedekFarkas BenedekFarkas Apr 18, 2024

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Updated in a5e4f1c.

}

ContentItem localizedContentItem = localizationPart.ContentItem;
localizedRoute = localizedContentItem.Parts.Single(p => p is AutoroutePart).As<AutoroutePart>();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single is evil, it will throw if it's not exactly one element. But you might also want that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I didn't notice it. As far as I can tell, it's not necessary to use it here. .Single is used in some other parts in Orchard (mostly in tests, but not only) to find a part by its name, but when the type is known, .As<> should be fine, since you can't have more than one of a (statically typed) part. Fixed in bf9b9b0.

@BenedekFarkas BenedekFarkas changed the title 6793: Adding a content-independent culture selector shape for the front-end #6793: Adding a content-independent culture selector shape for the front-end Apr 18, 2024
@BenedekFarkas
BenedekFarkas merged commit 15cad85 into OrchardCMS:1.10.x Apr 18, 2024
BenedekFarkas added a commit that referenced this pull request Apr 19, 2024
* 6748: Stricter file and folder name validation (#6792)

* Media Library: More strict file and folder name validation, fixes #6748

* Resetting MediaLibraryService changes to 1.10.x

* Code styling in FileSystemStorageProvider

* Adding string file and folder name validation to FileSystemStorageProvider, so that MediaLibrary components don't need to do it separately

* Applying the same file and folder name validation to AzureFileSystem too

* Code styling and fixes in AzureFileSystem, MediaLibrary and IStorageProvider

* Simplifying invalid character detection

* Code styling

* Adding InvalidNameCharacterException to be able to handle invalid characters precisely at various user-facing components

* Updating MediaLibrary not to log an error when a file can't be uploaded due to invalid characters

---------

Co-authored-by: Lombiq <[email protected]>

* #6793: Adding a content-independent culture selector shape for the front-end (#8784)

* Adds a new CultureSelector shape for front-end

* fixed query string culture change

* Moving NameValueCollectionExtensions from Orchard.DynamicForms and Orchard.Localization to Orchard.Framework

* Code styling

* Simplifying UserCultureSelectorController and removing the addition of the culture to the query string

* EOF empty lines and code styling

* Fixing that the main Orchard.Localization should depend on Orchard.Autoroute

* Code styling in LocalizationService

* Updating LocalizationService to not have to use IEnumerable.Single

* Matching culture name matching in LocalizationService culture- and casing-invariant

---------

Co-authored-by: Sergio Navarro <[email protected]>
Co-authored-by: psp589 <[email protected]>

* #8640: Fixing consistency between different Enumeration Field flavors' data storage (#8789)

* Reworking EnumerationField's logic to store/retrieve its (selected) values

* Fixing exception when creating new item with CheckboxList flavor, adding more nullchecks and compactness

* Code styling in EnumerationFieldDriver

* Code styling in EnumerationField editor template

* Fixing that EnumerationFieldDriver and the EnumerationField editor template should read SelectedValues instead of Values directly

---------

Co-authored-by: Matteo Piovanelli <[email protected]>

* Fixing merge

---------

Co-authored-by: Lombiq <[email protected]>
Co-authored-by: Sergio Navarro <[email protected]>
Co-authored-by: psp589 <[email protected]>
Co-authored-by: Matteo Piovanelli <[email protected]>
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

Successfully merging this pull request may close these issues.

Localization Module don't provide a proper culture selector for front-end

3 participants