Filter options Localization support
Currently, it's not possible to create a localized filter option
input CreateFilterOptionInput {
value: String!
title: String!
}
its always using locale from the context but it should be possible to override this when required
const filter = await modules.filters.createFilterOption(
filterId,
{ ...option, locale: context.localeContext.language },
context,
);
Using the locale only from the context is just fine, it will ensure that the selected language i'm usually seeing is used which is also a supported language and primarily the default language when creating a new option or any other entity.
If we'd change this, we'd need to enable this for all other "Create Text Input Types" for ex. CreateProductVariationInput, CreateProductVariationOptionInput, CreateProductInput, CreateAssortmentInput.
To add another localized string to an option it's this here with providing the filterOptionValue (UpdateFilterTextInput has locale):
"""
Updates or created specified filter texts for filter with ID provided and locale and optionally filterOptionValue
"""
updateFilterTexts(
filterId: ID!
filterOptionValue: String
texts: [UpdateFilterTextInput!]!
): [FilterTexts!]!
I think the way it is now it's consistent and changing all of the other types is a bit too much for the benefit.
@pozylon we need it to implement this case https://github.com/xecutors/unchained-adminui/issues/488#issuecomment-2100044334 otherwise when adding a new text it will always default to context locale
@Mikearaya please add all of our discussed requirements to a ticket and open a new PR once you have it working
or yes, use this one ^^