globalize3

Simple search on a Globalize3 table in Rails

…衆ロ難τιáo~ 提交于 2019-12-03 16:09:35
I am looking to implement a simple search function while using the globalize3 gem for Ruby on Rails. Since the translations of the model are stored in a separate table, the code below doesn't work as there is no longer a :name field in the products table. How can I adjust the code below to make the search function correctly? products_controller.rb @products = Product.search(params[:search]).all index.html.erb <%= form_tag products_path, method: :get do %> <%= text_field_tag :search, params[:search] %> <%= submit_tag "Search", name: nil %> <% end %> model class Product < ActiveRecord::Base

How to avoid Globalize3 from returning fallback translations for an attribute into a specific context?

℡╲_俬逩灬. 提交于 2019-12-01 18:16:12
I'm working in the internationalization/localization of web site using Globalize3 and easy_globalize_accesors and right now I'm adapting the forms to manage fields with possible translations. Suppose I have a class named Role: class Role translates :name, :fallbacks_for_empty_translations => true # rest of class definition I've done this because I want to show the default translation if there isn't a translation or is empty in the current locale and this works as expected. But, in my form I want the opposite: I would like to have each input who refers to a different locale than default locale

How to avoid Globalize3 from returning fallback translations for an attribute into a specific context?

ⅰ亾dé卋堺 提交于 2019-12-01 17:52:59
问题 I'm working in the internationalization/localization of web site using Globalize3 and easy_globalize_accesors and right now I'm adapting the forms to manage fields with possible translations. Suppose I have a class named Role: class Role translates :name, :fallbacks_for_empty_translations => true # rest of class definition I've done this because I want to show the default translation if there isn't a translation or is empty in the current locale and this works as expected. But, in my form I