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

locale translations issue fix #61

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions extensions/extra_locales_controller.rb
@@ -0,0 +1,16 @@
module ExtraLocalesControllerCustomWizard
def show
if request.referer && URI(request.referer).path.include?('/w/')
bundle = params[:bundle]

if params[:v]&.size == 32
hash = ::ExtraLocalesController.bundle_js_hash(bundle)
immutable_for(1.year) if hash == params[:v]
end

render plain: ::ExtraLocalesController.bundle_js(bundle), content_type: "application/javascript"
else
super
end
end
end
2 changes: 2 additions & 0 deletions plugin.rb
Expand Up @@ -77,6 +77,7 @@
../serializers/custom_wizard/wizard_step_serializer.rb
../serializers/custom_wizard/wizard_serializer.rb
../serializers/custom_wizard/log_serializer.rb
../extensions/extra_locales_controller.rb
../extensions/invites_controller.rb
../extensions/users_controller.rb
../extensions/wizard_field.rb
Expand Down Expand Up @@ -157,6 +158,7 @@
redirect_to_wizard_if_required if current_user
end

::ExtraLocalesController.prepend ExtraLocalesControllerCustomWizard
::InvitesController.prepend InvitesControllerCustomWizard
::UsersController.prepend CustomWizardUsersController
::Wizard::Field.prepend CustomWizardFieldExtension
Expand Down