glebm / i18n-tasks

Manage translation and localization with static analysis, for Ruby i18n
http://glebm.github.io/i18n-tasks
MIT License
2.07k stars 263 forks source link

How to disable AST scanner? #181

Closed ajb closed 8 years ago

ajb commented 8 years ago

It seems like the AST scanner is having a bit of trouble parsing out keys from Erector views, which have a .rb extension. I'd like to disable the scanner to see if this is indeed the case, but I can't quite figure out how to do so in the configuration. Is there a way to do this with the config or in an initializer?

Thanks!

glebm commented 8 years ago

You can set the search.scanners setting explicitly (see the right format for this by running i18n-tasks config), e.g.:

search:
  scanners:
  - - "::I18n::Tasks::Scanners::PatternWithScopeScanner"
    - ignore_lines:
        rb: "^\\s*#(?!\\si18n-tasks-use)"
        opal: "^\\s*#(?!\\si18n-tasks-use)"
        haml: "^\\s*-\\s*#(?!\\si18n-tasks-use)"
        slim: "^\\s*(?:-#|/)(?!\\si18n-tasks-use)"
        coffee: "^\\s*#(?!\\si18n-tasks-use)"
        erb: "^\\s*<%\\s*#(?!\\si18n-tasks-use)"
ajb commented 8 years ago

Thanks!