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 24 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)

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!

kennyadsl and others added 15 commits April 8, 2022 15:05
…adsl/solidus-3

Update solidus_globalize to use Solidus 3.0
…-for-dev/support_forked_solidus_frontend

Update to use forked solidus_frontend when needed
The override allows the product name search term to be retained after
search results are shown. This was not working because the search param
is for the product translations and did not match the field name.
…t-name-search-retention

Fix product name search retention
Reinitialize the extension with the new defaults of solidus_dev_support,
and update gemspec to allow Solidus 4.
This is a blind conversion, only needed to remove that tech
from the stack.

Also the content has been moved to the main JS file, which is the one
being loaded by applications.
…adsl/allow-solidus-4

Make the extension compatible with Solidus 4
@harmonymjb harmonymjb force-pushed the gr/configurable-translatable-fields branch from d7a8427 to a175167 Compare January 21, 2025 19:58
This is no longer available for any supported solidus version
After ransack v4, we need to declare these methods on the Translation
model if they are ransackable associations.

activeadmin/activeadmin#8033 (comment)
Routing translations is not directly supported by solidus globalize
and the upstream dependency doesn not support rails 7. In order to
test against newer versions of solidus, these tests are changed to use
the query param instead.
This gem was only utilized in the test sandbox, but users are expected
to configure locale routing themselves. Since this gem does not
support rails 7.

svenfuchs/routing-filter#87
@harmonymjb harmonymjb force-pushed the gr/configurable-translatable-fields branch 2 times, most recently from aa26654 to ab8abd1 Compare January 23, 2025 22:06
Globalize 6 provides an override for serialize that only suits the
deprecated signature.

This override is applied only if Rails is >= 7.1 and Globalize is < 7
Since globalize 6 does not support Rails 7.2, no handling of Globalize
6 with Rails 7.2 is needed.

The override here is from Globalize v7.0.0 and will be modified in the
next commit.
harmonymjb and others added 4 commits January 27, 2025 15:20
The Globalize 6 override that exists in the ancestor chain requires
this value to be passed from :type.
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.
@harmonymjb harmonymjb force-pushed the gr/configurable-translatable-fields branch from ab8abd1 to 6327114 Compare January 27, 2025 23:24
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.

7 participants