Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 20 23:39

    glebm on main

    Ensured Aliased values work (#4… (compare)

  • Jan 20 23:39
    glebm closed #415
  • Jan 20 23:39
    glebm closed #412
  • Jan 19 22:52
    colinbruce synchronize #415
  • Jan 19 20:44
    colinbruce edited #415
  • Jan 19 20:44
    colinbruce ready_for_review #415
  • Jan 19 20:42
    colinbruce edited #415
  • Jan 19 20:41
    colinbruce synchronize #415
  • Jan 19 20:37
    colinbruce synchronize #415
  • Jan 19 18:36

    glebm on main

    Include Ruby 3.1 in github work… (compare)

  • Jan 19 18:36
    glebm closed #414
  • Jan 19 18:36
    glebm edited #414
  • Jan 19 15:33
    glebm commented #412
  • Jan 19 08:48
    colinbruce commented #412
  • Jan 19 07:58
    colinbruce synchronize #415
  • Jan 19 07:53
    colinbruce synchronize #415
  • Jan 19 07:37
    colinbruce synchronize #415
  • Jan 18 15:26
    colinbruce edited #415
  • Jan 18 15:25
    colinbruce opened #415
  • Jan 18 15:08
    colinbruce commented #414
Gleb Mazovetskiy
@glebm
Great, it works!
So, I accepted a boring Java job at ACME corp, and I won't have much time to develop i18n-tasks in the near future
So I figured it's time to move i18n-tasks to an org
Rails i18n doesn't have an org yet, so let's start one
@ezuk has been working on an informational portal for Rails I18n, so far it has a number of interviews, more is coming http://ruby-i18n.github.io/rails-i18n.org/
Gleb Mazovetskiy
@glebm
Just found this https://github.com/ruby-i18n, invited Paul here
Tsvetelina Borisova
@tborisova
Hi
Can I use this gem with ruby 18.7?
1.8.7*
Gleb Mazovetskiy
@glebm
@tborisova nope sorry
@tborisova However, you can install ruby 2.1 and use the gem, regardless of what ruby your project requires
@tborisova 1.9.3 minimum
Tsvetelina Borisova
@tborisova
thanks
Alexey Shein
@conf
Hi
I've just started to use your gem (great by the way) and noticed that it doesn't use translations from gem 'russian'
Do you have any solution for this?
Alexey Shein
@conf
Oh, nevermind. I've read documentation again and found solution:
# read from a gem (config is parsed with ERB first, then YAML)
- "<%= %x[bundle show russian].chomp %>/lib/russian/locale/*.yml"
Julien Vanier
@monkbroc
Hi
Can you point me in the right direction to make the key matcher regexp more permissive? I have keys like t("home.index.100+_categories") that are marked as unused because of the +. I'm not sure which config to change or const to monkeypatch to allow +, $ and % in the translation keys.
Didn't know this was allowed in yaml :)
Julien Vanier
@monkbroc

Thanks. Here's how I monkeypatched it.

In i18n-task.yml

<% require('./config/initializers/i18n-tasks.rb') %>

base_locale: en
#...

In config/initializers/i18n-tasks.rb

if defined? I18n::Tasks::Scanners::BaseScanner
  # Monkeypatch the list of string symbols with a more permissive
  # version to make the i15r and i18n-tasks gems compatible
  I18n::Tasks::Scanners::BaseScanner.send(:remove_const, :VALID_KEY_RE)
  I18n::Tasks::Scanners::BaseScanner.const_set(:VALID_KEY_RE, /^([-\w.?!;:+$%@]|[\#{@}])+$/)
end
By the way, the reason I have those keys is that I'm using the i15r gem to automatically extract strings from my views. It generates symbols with +, $ and %.
John Nico Garcia
@Winter41
Love this gem!
Jack Chan
@jchanfnet
I used the i18n-tasks normalize command, and it split my long strings into multiple lines. Is there any way to disable that?
Jack Chan
@jchanfnet
found it. just gotta change the config to line_width: -1 under yaml write
Colin Browne
@ceres629
I'm currently using i18n gettext helpers instead of the default t() translate functions. Gettext uses () instead of t() however i18n-tasks does not detect this as a key in my views. Is there anyway to tell i18n-tasks that () also signifies a key?
Gleb Mazovetskiy
@glebm
@ceres629 You can override the scanner pattern by inheriting from the scanner and specifying the new scanner in the config. I suggest you use v0.9.0.rc2 for this
@ceres629 For 0.9, the easiest would be to monkey-patch this method https://github.com/glebm/i18n-tasks/blob/0.9-dev/lib/i18n/tasks/scanners/pattern_scanner.rb#L85 and to pass a different receivers: argument to the AST scanner constructor via the config
Colin Browne
@ceres629
many thx! I was able to figure it out thanks to your pointers!
Colin Browne
@ceres629

Is the strict config setting working in 0.9.0? I've added

search:
  strict: false

To my i18n-tasks.yml in my project, but it doesn't have any effect.

Gleb Mazovetskiy
@glebm
@ceres629 That's strange, there is currently a passing test for this https://github.com/glebm/i18n-tasks/blob/0.9-dev/spec/i18n_tasks_spec.rb#L110
@ceres629 Perhaps it's a problem with config parsing, can you please have a look?
Russell Osborne
@rposborne
Quick question I am trying to inject nil values for missing keys vs an empty string any hints on how to achieve this?
found
glebm/i18n-tasks#170
Russell Osborne
@rposborne
I am attempting to write a custom scanner for Spree, using the 0.9.0-rc2 release. Maybe someone can point me in the right direction, Spree uses a helper Spree.t("key") to use the spree namespace in I18n. I have successfully writing a Scanner for this but I am dealing with an overly eager PatterMatcherWithScope that matches these the above call again.
Gleb Mazovetskiy
@glebm
@rposborne Eager matching fixed in glebm/i18n-tasks@f15d762
@rposborne Unfortunately, this did not make it into v0.9.0 release
Gleb Mazovetskiy
@glebm
@rposborne Now released in v0.9.1
Russell Osborne
@rposborne
Awesome thanks! @glebm
souravongit
@souravongit
This message was deleted
souravongit
@souravongit
i installed it on my application. when im trying to run it show error like "i18n-tasks: Error scanning app/controllers/api/v1/bank_branches_controller.rb: undefined methodtransform_values' for {}:Hash
". If i exclude controllers from config/i18n-tasks.yml then it works.mainly not working on .rb file.Please help me out.
Colin Browne
@ceres629
I am trying to add a custom scanner and I'm sure I'm following the method outlined in the readme but I keep getting: i18n-tasks: [DEPRECATED] search.scanner is now search.scanners, an array of [ScannerClass, options] /usr/local/opt/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.4/lib/active_support/inflector/methods.rb:261:inconst_get': uninitialized constant GettextScanner (NameError)`
I put a gist of what I've done here https://gist.github.com/ceres629/c048941009b0b4f0527c
is there a step i'm missing?
Colin Browne
@ceres629
I previously tried to do this before and couldn't get it working, the only thing i got working was to modify the gem itself and add the scanner that way, but I would prefer not to have to do it this way.
Colin Browne
@ceres629
okay silly me, I realise now you either have i18n-tasks.yml.erb or i18n-tasks.yml, not both
putting the contents of the .yml into .yml.erb works fine.