nachopal / dry_i18n Goto Github PK
View Code? Open in Web Editor NEWA gem for not repeating yourself adding translations. It permits you to reuse I18n keys
License: MIT License
A gem for not repeating yourself adding translations. It permits you to reuse I18n keys
License: MIT License
@NachoPal When I use I18n.transliterate
with dry_i18n gem, happens the following error:
I18n.transliterate('something')
# => NoMethodError: undefined method `scan' for {}:Hash
# from /usr/local/rvm/gems/ruby-2.4.1@my_app/gems/dry_i18n-1.0.0/lib/dry_i18n.rb:31:in `variables?'
When I use the command of gem Faker
Faker::Name.title.parameterize.underscore
return this error:
NoMethodError: undefined method `scan' for #<Array:0x000055bbb332ba80>
from /usr/local/bundle/gems/dry_i18n-1.0.0/lib/dry_i18n.rb:31:in `variables?'
Complete error in console
NoMethodError:
undefined method `scan' for #<Array:0x000055e5966ff398>
# /usr/local/bundle/gems/dry_i18n-1.0.0/lib/dry_i18n.rb:31:in `variables?'
# /usr/local/bundle/gems/dry_i18n-1.0.0/lib/dry_i18n.rb:10:in `translate'
# /usr/local/bundle/gems/i18n-0.9.5/lib/i18n.rb:169:in `block in translate'
# /usr/local/bundle/gems/i18n-0.9.5/lib/i18n.rb:165:in `catch'
# /usr/local/bundle/gems/i18n-0.9.5/lib/i18n.rb:165:in `translate'
# /usr/local/bundle/gems/faker-1.8.7/lib/faker.rb:157:in `rescue in translate'
# /usr/local/bundle/gems/faker-1.8.7/lib/faker.rb:145:in `translate'
# /usr/local/bundle/gems/faker-1.8.7/lib/faker.rb:98:in `fetch'
# /usr/local/bundle/gems/faker-1.8.7/lib/faker/name.rb:34:in `title'
# ./spec/factories/configuration.rb:5:in `block (3 levels) in <main>'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/attribute/dynamic.rb:16:in `instance_exec'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/attribute/dynamic.rb:16:in `block in to_proc'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/evaluator.rb:77:in `instance_exec'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/evaluator.rb:77:in `block in define_attribute'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/attribute_assigner.rb:56:in `get'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/attribute_assigner.rb:16:in `block (2 levels) in object'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/attribute_assigner.rb:15:in `each'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/attribute_assigner.rb:15:in `block in object'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/attribute_assigner.rb:14:in `tap'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/attribute_assigner.rb:14:in `object'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/evaluation.rb:13:in `object'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/strategy/create.rb:9:in `result'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/factory.rb:43:in `run'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/factory_runner.rb:29:in `block in run'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/factory_runner.rb:28:in `run'
# /usr/local/bundle/gems/factory_bot-4.8.2/lib/factory_bot/strategy_syntax_method_registrar.rb:20:in `block in define_singular_strategy_method'
# ./spec/models/configuration_spec.rb:5:in `block (2 levels) in <main>'
# ./spec/models/configuration_spec.rb:12:in `block (2 levels) in <main>'
# ------------------
# --- Caused by: ---
# I18n::MissingTranslationData:
# translation missing: pt-BR.faker.name.title.descriptor
# /usr/local/bundle/gems/i18n-0.9.5/lib/i18n.rb:326:in `handle_exception'
@NachoPal Can help?
We are currently upgrading from rails 6.1.0 to rails 7.0.4 and discovered this error.
FrozenError: can't modify frozen Array: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
from .../gems/dry_i18n-1.0.1/lib/dry_i18n.rb:13:in `block in translate'
This happens for I18n.t('date.abbr_day_names') and for I18n.l(DateTime.current, format: '%B %Y')
Here is the yml file, to reproduce the error.
en:
date:
abbr_day_names:
- Sun
- Mon
- Tue
- Wed
- Thu
- Fri
- Sat
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.