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

Configurable translatable fields #1

Open
wants to merge 4 commits into
base: kennyadsl/solidus-3
Choose a base branch
from

Conversation

harmonymjb
Copy link
Collaborator

@harmonymjb harmonymjb commented Sep 16, 2021

This small change allows application configuration of translatable fields on Spree models decorated with globalize.

I've tested this in our client app as follows, which removes :name from translatable fields for Spree::OptionValue.

SolidusGlobalize::Config[:translatable_fields].merge!(
  {
    'Spree::OptionValue' => [:presentation]
  }
)

I was unable to bundle and test this repo, as there are dependency version issues.

P.S.

Not sure of where would be the best place to PR this as we use a non-main branch (kennyadsl/solidus-3)

Graham Bouvier added 2 commits September 16, 2021 16:38
Previously, translatable fields were hard-coded in the various decorators.
With this change, they can be overridden with configuration in the client application
using similar configuration patterns to other solidus extensions.
Copy link
Member

@jarednorman jarednorman left a comment

Choose a reason for hiding this comment

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

This rules.

Copy link
Member

@benjaminwil benjaminwil left a comment

Choose a reason for hiding this comment

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

Amazing!

This was blocking support for Ruby 3.0 in this extension.
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.

3 participants