Questions tagged [mobility]

Mobility is a pluggable translation framework for Ruby.

Mobility is a ruby gem for storing and retrieving translations as attributes on a class. Storage of translations is handled by customizable "backends" which encapsulate different storage strategies, including translatable columns and model translation tables, as well as database-specific storage solutions such as jsonb and Hstore (for PostgreSQL).

85 questions
1
vote
1 answer

Jade Library- Agent mobility between containers

I wrote a piece of code representing an agent using jade library traveling across containers. My agent has a Cyclic Behavior that use a simple switch-case statements to travel across containers. It runs at the 'Main-Container' then goes to…
Hadi
  • 5,328
  • 11
  • 46
  • 67
1
vote
0 answers

how to detect if the user have a bigger font setting in the browser OR in the mobile phone settings

This question is about detecting if the user changed his font size on his device or browser CONTEXT : a normal website this website viewed with a desktop (regular browser) mobile in chrome or safari within a webview on a mobile app etc ISSUE…
Jintor
  • 607
  • 8
  • 32
1
vote
1 answer

Importing via csv data in jsonb format

Using the mobility gem for i18n, the process of importing data from CSV for jsonb data is not succeeding. Whereas, one generally imports Class.create( name_en: row[2], name_fr: row[3], [...] for the local-driven values in a key_value backend,…
Jerome
  • 5,583
  • 3
  • 33
  • 76
1
vote
1 answer

How column_fallback works?

How does column_fallback work? I've added the line column_fallback to the initializer and set in the model something like: extend Mobility translates :title, type: :string, column_fallback: true [2] pry(main)> b.title => "Ecologia política" [3]…
1
vote
2 answers

Eager loading mobility translations on a model collection

I have a simple problem with the mobility gem. I have a simple relation in my models. Let's say Company has many Employees, and Employees have a translated attribute :job_function that uses backend: :table. class Company < ApplicationRecord …
Mladen Danic
  • 3,600
  • 2
  • 25
  • 24
1
vote
0 answers

Mobility fallback not working in unit tests (while working in console)

I'm switching from Globalize gem to Mobility gem in my app. I'm facing an issue with Mobility fallbacks: empty attribute correctly falls back to another language in console, but it doesn't in unit tests. I don't understand why nor how to fix…
1
vote
1 answer

SUMO mobility model

By default, SUMO used the Krauss Car-following model, is it possible to change the parameter, and how? Secondly, how can I also change from the default car-following to the lane-changing model in SUMO? Thank you in anticipation of your answer.
1
vote
0 answers

Translating Rails has_many string attribute using Mobility

Context Considering a Rails 6 application with a sluggable polymorphic relation, a model's has_many collection of slugs localized to different languages can be modeled as follows: # slugs table schema create_table :slugs do |t| t.references…
1
vote
1 answer

Replacing translations using ActiveAdmin

I'm trying to use Mobility in my Rails application with ActiveAdmin as administration panel. I use Container backend with JSONB column. I also have activeadmin_json_editor gem installed so it's not possible to produce bad JSON. Inside my admin…
1
vote
1 answer

How do I filter records by locale using gem mobility?

I have a table mobility_string_translations, but I do not understand how to get to it. Now I have three records. Two records in German and one in Spanish. I want to get only those records that are in German. this not working: all_de_posts =…
deboyo
  • 15
  • 5
1
vote
1 answer

Mobility gem + Rails : how to perform a join with LIKE query on a translated model

I had this query working before implementing Mobility on my app : Product.joins(:category).where('categories.name ILIKE ANY ( array[?] )', categories) where categories is = params[:categories].map {|category| "%#{category}%" } After having…
guillaume
  • 651
  • 6
  • 14
1
vote
1 answer

How to get changed attributes without locale suffixes in Mobility gem?

The documentation about dirty tracking in the mobility gem states that: Mobility uses locale suffixes to indicate which locale has changed; dirty tracking is implemented this way to ensure that it is clear what has changed in which locale, avoiding…
Simon
  • 322
  • 1
  • 13
1
vote
1 answer

Dynamic fallback for empty translations? - Mobility

Im using the Mobility gem (v0.4.3 - https://github.com/shioyama/mobility) and Rails 5.2, and at the moment to set fallbacks I have to set up this in the model: class Client < ApplicationRecord .... extend Mobility translates :title, type:…
darkcode
  • 868
  • 12
  • 27
1
vote
1 answer

What is the Difference between a Device Policy Controller (DCP) app and a System App?

Is there any difference in the privileges of an Android DPC application and a system application? Will a system application be able to perform all the functions that a DPC can perform such as setting the device to Single Use Mode?
Heshan Perera
  • 4,592
  • 8
  • 44
  • 57
1
vote
1 answer

Custom Writer and Accessors using JSONB with Mobility

Mobility Version: 0.4.2 / Rails Version: 5.2.0.rc1 In a Rails app using Mobility I have a model structure that looks like this: create_table :settings do |t| t.string :type t.jsonb :values, null: false, default: {} t.timestamps end add_index …
darkcode
  • 868
  • 12
  • 27