Questions tagged [mobility]

Mobility is a pluggable translation framework for Ruby.

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

In globalize/mobility gem: can I use other context parameters than the locale?

I would like to extend the mobility gem so that I can show different text based on the context such as a region or industry. Example: User is speaking Spanish and is in the Automotive industry => ...
Mike's user avatar
  • 351
0 votes
0 answers
25 views

Mobility should save all record attributes shouldn't it?

I added a virtual attribute to a record via attribute like this. class Question < ApplicationRecord extend Mobility attribute :hint translates :hint, type: :text end Works so far. Even the ...
seppsepp's user avatar
0 votes
0 answers
25 views

Mobility gem default fallback for all missing translations

I'm wondering how it's possible to set a default fallback for all missing translations at once for the Mobility gem (https://github.com/shioyama/mobility). As far as I understood the documentation the ...
seppsepp's user avatar
0 votes
0 answers
48 views

How to model the doppler shift/effect due to node mobility in Rayleigh and Rician channels in MATLAB

I am trying to simulate the Bit Error rate (BER) vs. Signal-to-noise (SNR) ratio of vehicle-to-vehicle communication using the IEEE 802.11p standard to determine how the BER vs SNR is influenced by ...
SAMetrix's user avatar
0 votes
2 answers
27 views

Rails Internationalisation for ActiveStorage & ActionText

Rails has internal patterns for which it generates tables to handle polymorphic associations has_one_attached :document has_many_attached :pictures has_rich_text :body However, this polymorphism ...
Jerome's user avatar
  • 5,747
0 votes
0 answers
36 views

VANET: How to Implement A* Routing Algorithm in SUMO Simulation with Existing Configuration, Network, Trips, and Routing Files for research purpose?

I'm working on a PhD research topic involving SUMO (Simulation of Urban MObility), and I'm trying to integrate the A* algorithm into my existing simulation. I have the following files: my_simulation....
Rohail Rasheed's user avatar
0 votes
0 answers
16 views

Is there a way to get translatable attributes of a model extended with Mobility gem?

Is there a way to get translatable attributes of a model extended with Mobility gem? I've got a parent -> child objects conversion. Parent and child are different models even though they have ...
Marat's user avatar
  • 622
0 votes
0 answers
37 views

how to solve "implicit chunk serialization is disabled" error

I am working on a d2d communication in which I have used user1 sending packets to user2 using UDP, this worked well until I try to switch between IM to DM. Now I am getting following error. implicit ...
Urooj Qureshi's user avatar
0 votes
1 answer
36 views

how to get the constraint area values from .ini file

I am trying to get the mobility constraint area that they are in the .ini file . **.constraintAreaMaxX = 1000m **.constraintAreaMaxY = 1000m **.constraintAreaMaxZ = 1000m in my Mobiledrone.cc file : ...
kim's user avatar
  • 1
0 votes
1 answer
73 views

Testing with Minitest validation of translation presence using mobility gem

Testing an application that implements the mobility gem with Minitest, a custom validator class CustomValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) if ...
Jerome's user avatar
  • 5,747
0 votes
0 answers
69 views

Mobility management function

I am not sure if it is the right community here for this question. I am looking for information on what mobility management function exactly means. ( in the context of dynamic reconfiguration of ...
Aid22's user avatar
  • 1
0 votes
0 answers
227 views

can't get fallbacks to work in rails + mobility

I'm having some issues with configuring the mobility gem. If a translation isn't present, I would like to get the default translation (in this case :de should fallback to :en). I built a test which ...
Henrik's user avatar
  • 203
1 vote
0 answers
114 views

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 ...
Jintor's user avatar
  • 627
0 votes
0 answers
28 views

Eager loading model instances using single SQL statement with Mobility table backend

Using Rails 7 and Mobility 1.2.9: # config/initializers/mobility.rb Mobility.configure do |config| config.plugins do backend :table active_record reader writer backend_reader ...
Sébastien Dubois's user avatar
0 votes
2 answers
358 views

How to use validations with mobility gem?

I'm trying to add validations to my mobility-powered application and i'm confused a little.Earlier I've used code like this I18n.available_locales.each do |locale| validates :"name_#{locale}&...
Alexey Poimtsev's user avatar
0 votes
2 answers
287 views

How to setup fixtures when using Mobility with a Key Value backend?

Got a question on how to setup fixtures for Mobility. Would be very grateful for any tips on how to get this going and would be a valuable lesson for me as well on how to tackle setting up fixtures in ...
csalmeida's user avatar
  • 578
1 vote
1 answer
62 views

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], [...] ...
Jerome's user avatar
  • 5,747
0 votes
0 answers
83 views

Mobility i18n with includes

I'm using includes to avoid N+1 queries. However, I'm using Mobility in nested elements. This is what I've tried, but I'm getting an error: undefined method 'i18n' for #<ActiveRecord::...
Dan's user avatar
  • 1,271
1 vote
1 answer
108 views

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 [...
Bruno Berchielli's user avatar
0 votes
1 answer
659 views

How to upsert_all/insert_all with Mobility

I need to save a large number of posts with a translated body attribute, so I'm trying to use insert_all/upsert_all in conjunction with Mobility. Saving posts individually works just fine: Post.create(...
baka-san's user avatar
  • 131
0 votes
1 answer
324 views

How do I handle a like query using Mobility in Rails?

The title says it all. The goal is to handle a simple search. Trying to do this in my controller, which worked with Globalize: query = "%#{query}%" docs = Doc.i18n.where(category_id: ...
croceldon's user avatar
  • 4,523
1 vote
2 answers
464 views

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: :...
Mladen Danic's user avatar
  • 3,600
0 votes
1 answer
252 views

Rails Admin integration with Mobility gem

I'm trying to use the Mobility gem with Rails Admin. I am able to edit fields through the Rails Admin interface (like the impact_description of a Ngo model) and it correctly changes the translation ...
Nicholas Marques's user avatar
2 votes
1 answer
163 views

How to use pg_search_scope with Mobility for translated attributes?

how can i use pg_search_scope in combination with Mobility for translated attributes? Available languages are :de and :en. Searching for category names return empty results. There mus be a way to ...
axcr's user avatar
  • 21
0 votes
1 answer
120 views

Moving more than one node simultaneously in contiki-os (Mobility)

Do the lines need to be in time order? e.g. #node time(s) x y 0 1.1 50.26 139.3 1 1.1 55.26 144.3 0 1.3 60.26 153.1 1 1.3 65.26 158.1 ... I've only done single-node movement myself, but that's ...
Rejeti Megha Vardhan's user avatar
0 votes
1 answer
772 views

Avoiding double query when eager loading Active Record association?

In order to make a single DB query, I am eager loading Posts along with their translation data (using Rails 6 and Mobility (*)), but instead it yields 2 SQL queries: # app/models/post.rb class Post &...
Sébastien Dubois's user avatar
1 vote
0 answers
143 views

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 ...
Pierre-Yves O.'s user avatar
1 vote
1 answer
159 views

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?...
Mustapha Abubakar Ahmed's user avatar
0 votes
0 answers
134 views

Accessing Translations Tables via console

If one dumps the output of a postgresql DB, there are two tables indicated (and expected): mobility_text_translations mobility_string_translations COPY public.mobility_string_translations (id, locale,...
Jerome's user avatar
  • 5,747
0 votes
1 answer
101 views

rails using dirty method for tracing purposes using mobility gem

A rails controller method is attempting to pass object changes if @union.update(union_params) puts '||' puts @union.changed puts @union.changes @union.update_with_log(union_params, ...
Jerome's user avatar
  • 5,747
0 votes
0 answers
54 views

Table backend translations self-destruct when set to null-sy value

Not sure if this is a bug, a feature, a missed doc or a bad config, however when I set all of the translation attributes to a null-sy value, then the translation record self-destructs. I have the ...
dropbeardan's user avatar
  • 1,100
0 votes
1 answer
46 views

Any chance of expanding data types for mobility

I love the gem and how it works, I was just wondering if there was any existing or planned functionality to specify data types other than text and string for the translations (stored in mobility_[type]...
dropbeardan's user avatar
  • 1,100
0 votes
1 answer
93 views

Sorting a result defined by remote parameters

i have this index action: def index limit = params[:limit] page = params[:page] sort = params[:sort].split(',') @term = nil if params[:search] @term = params[:search] ...
Andreas's user avatar
  • 21
3 votes
1 answer
745 views

How to validate translations using locale or fallthrough accessors in mobility?

How can I validate a model with locale or fallthrough accessors with mobility gem using the accessors on creation or updating? Using mobility gem: v1.0.5 c = Category.new(name_en: 'Cat. 1', name_de: '...
phlegx's user avatar
  • 2,636
0 votes
1 answer
38 views

Maximum Mobility Speed in OMNET++

I am trying to implement AD HOC wireless project with mobility I wanted to know the maximum mobility speed of a node during a simulation in omnet++?
Rida Hanif's user avatar
1 vote
0 answers
313 views

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 ...
Sébastien Dubois's user avatar
0 votes
2 answers
515 views

Set per request i18n fallbacks in Rails?

I have a multi-country Rails app. And I need to set per request i18n fallbacks schema. Is it possible and how to achieve this? UPD class Country < ApplicationRecord # String attribute "...
Molfar's user avatar
  • 1,441
0 votes
1 answer
169 views

Language switching with Mobility Gem

How can I create a language toggle with the Mobility gem? Coming from Globalize I was using: <% if I18n.locale == I18n.default_locale %> <% Globalize.with_locale(:fr) do %> <%= ...
bgilbank's user avatar
2 votes
2 answers
544 views

Rails translate rich text with Mobility and ActionText as backend?

Mobility has a syntax to translate Rails ActiveRecord strings and text: class Word < ApplicationRecord extend Mobility translates :content end On the other hand, here is the syntax to declare ...
Sébastien Dubois's user avatar
2 votes
1 answer
950 views

How to access one project classes from other project While using multiple project with one Workspace

I am using two different project within one workspace. I have one base(Say Unity-iPhone) project and i drag and drop another iOS project (Say InnerApp). Each file and folder are visible in base ...
VipinYadav's user avatar
0 votes
0 answers
252 views

Using the `mobility` gem with advanced PostgreSQL types like text[]

We are using the mobility gem to translate database content in a rails 6 app running on PostgreSQL, and we’re making use of advanced database types such as text[] (array of text). Before installing ...
moeffju's user avatar
  • 4,373
0 votes
1 answer
269 views

How to call custom functions of Gem(By adding any attr_accessor/Method/Callbacks in model) whenever we run listing/find query from controller?

I am working on developing my custom gem which will be providing translations based on given parameters. I have used mobility gem https://github.com/shioyama/mobility as a dependency of my custom gem. ...
Milind Patel's user avatar
1 vote
1 answer
733 views

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 ...
Michał Zając's user avatar
0 votes
1 answer
128 views

Calling obj.i18.pluck in a model with a jsonb backend gives a TypeError

I'm using Mobility 0.8.4 and when I try to pluck an attribute from a model, it raises a TypeError. # models/skill.rb class Skill < ApplicationRecord extend Mobility translates :name, backend: ...
MendelGusmao's user avatar
1 vote
1 answer
472 views

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 ...
deboyo's user avatar
  • 15
1 vote
1 answer
887 views

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 {|...
guillaume's user avatar
  • 671
1 vote
1 answer
170 views

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 ...
Simon's user avatar
  • 322
0 votes
0 answers
52 views

Getting returned language when using fallbacks

Is there a way to get the language that the https://github.com/shioyama/mobility gem returned whe using a fallback? e.g i have something like this resource.description_backend.write(:en, "Foo") ...
Thollsten's user avatar
  • 223
1 vote
1 answer
454 views

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 .....
darkcode's user avatar
  • 878
1 vote
1 answer
841 views

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 ...
Heshan Perera's user avatar