blacklight

`scope` around `mount` ineffective?

痞子三分冷 提交于 2019-12-11 02:31:46
问题 (While this discusses Blacklight engine, I believe the question is actually purely about Rails.) I am trying to add internationalisation to my Blacklight app. To that end, I wrapped everything in config/routes.rb into scope "(:locale)", locale: /en|ja/ , and in app/controllers/application_controller.rb I added before_action :set_locale and overrode default_url_options as suggested by Rails i18n guide. Most things work, but there's one thing I haven't been able to figure out. All of my

`link_to` with parameters for an Engine route

无人久伴 提交于 2019-12-10 14:55:10
问题 (While this discusses Blacklight engine, I believe the question is actually purely about Rails.) Continuing my quest from scope around mount ineffective? (tl;dr: make the engine routes obey the same :locale scope as application routes), after digging through Rails source. Currently, I have this setup: # config/routes.rb Rails.application.routes.draw do Blacklight::Engine.routes.default_scope = { path: "(:locale)", locale: /en|ja/ } mount Blacklight::Engine => '/' scope "(:locale)", locale:

Page needs to be refreshed after switching locale for Blacklight label to translate

£可爱£侵袭症+ 提交于 2019-12-10 02:29:19
问题 I am trying to create an Arabic version of a Rails app which is based on Blacklight. Here's the problem I am facing: When I switch the language, everything translates perfectly EXCEPT the Blacklight labels. It's only when I refresh the page that the labels get translated. This is the label I want to display: "ترتيب حسب عام" (Translation: Sort by Year) But this is what I am getting currently: "Year ترتيب حسب" The same issue happens when switching back to English from Arabic - the label