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

Filter options Localization support #594

Open
Mikearaya opened this issue May 4, 2024 · 6 comments
Open

Filter options Localization support #594

Mikearaya opened this issue May 4, 2024 · 6 comments

Comments

@Mikearaya
Copy link
Contributor

Mikearaya commented May 4, 2024

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,
  );
@Mikearaya Mikearaya changed the title filter options Localization support Filter options Localization support May 4, 2024
@pozylon
Copy link
Member

pozylon commented May 8, 2024

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!]!

@pozylon pozylon closed this as completed May 8, 2024
@pozylon pozylon reopened this May 8, 2024
@pozylon pozylon closed this as completed May 8, 2024
@pozylon
Copy link
Member

pozylon commented May 8, 2024

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.

@Mikearaya
Copy link
Contributor Author

@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
Copy link
Contributor Author

Screenshot from 2024-05-08 15-13-50

@Mikearaya Mikearaya reopened this May 8, 2024
@pozylon
Copy link
Member

pozylon commented May 8, 2024

@Mikearaya please add all of our discussed requirements to a ticket and open a new PR once you have it working

@pozylon
Copy link
Member

pozylon commented May 8, 2024

or yes, use this one ^^

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

2 participants