Giter VIP home page Giter VIP logo

dry_i18n's People

Contributors

miguelsavignano avatar nachopal avatar pedrofurtado avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dry_i18n's Issues

Error when use I18n.transliterate

@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?'

Error in 'scan' method when used gem Faker

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?

Rails 7 can't modify frozen Array

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.