i18n ally not working with the Ruby on Rails framework (doesn't detect framework & annotations don't work)
See original GitHub issueDoesn’t work with the Rails framework. Framework is not auto-recognized (only after config), nor do any of the fancy stuff work, like annotations, hover or direct actions .
Extension Version Ruby 2.7.2 (latest) Rails 6.0.3.4 Vue i18n Ally (2.4.14) -->
Framework/i18n package you are using Default i18n package from Ruby on Rails (https://guides.rubyonrails.org/i18n.html), but can also be found here. https://github.com/svenfuchs/rails-i18n
To Reproduce I’ve created a completely new rails application out of the box.
- Create a new rails app from scratch:
rails new i18nally
(creates a new rails app in the folder ‘i18nally’
–> By this stage, the Rails Framework is not recognized (i18n ally button (world map) doesn’t show up). Only after adding the ‘ruby-rails’ to the enabled frameworks at i18n-ally.enabledFrameworks
is Rails recognized.
- Create a post section with db migration using rails generators (scaffolding)
rails g scaffold posts title body
- Run the migration
rails db:migrate
- Add a i18n translation to the newly created view in ‘views/posts/index’
Typically for i18n ally to work out of the box with Rails, the locale folder is in ‘config/locales’ (default configuration with Rails). Default locale is english, if not otherwise specified.
Device Infomation –> Copy from ‘About Visual Studio Code’ Version: 1.52.1 Commit: ea3859d4ba2f3e577a159bc91e3074c5d85c0523 Date: 2020-12-16T16:30:02.420Z (1 wk ago) Electron: 9.3.5 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Darwin x64 19.6.0
Extension Log
Go to View
-> Output
-> i18n Ally
, and paste the content below. You should mask any sensitive information
–> Doesn’t seem to work for me. Works up to View
-> Output
, but I can’t enter anything into the output tab --> read-only
Screenshots
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (5 by maintainers)
Top GitHub Comments
If the
gem rails
is present, you know for sure that Rails is installed. You can with high probability assume that i18n is installed too (presumably starting Rails applications with Rails 2.2 or higher - 2.2 was release in 2009. Today we have version 6.1). I can’t say this with 100% confidence, as I only gotten to Rails starting version 5.1. Another good approach would probably be to scan for a Gemfile.lock for a i18n entry. There you also have the exact version of rails (rails (6.0.3.4)
)This is what I got from a stackoverflow entry.
@terales : I’m happy to advise on Rails, because we are now using i18n_ally for our project to some extend (i18n_ally works well for translating the views, but not yet for the Rails controllers). Interestingly i18n_ally is not much talked about the Rails community (at least as far as I can tell), but I’d be sure if getting it setup with Rails would be simplified, adoption would increase significantly. (Because managing many keys manually is a huge pain)
I think a good start would be to do a video call with a screen share. I can show how a plain vanilla Rails project is set up. This would give you the understanding of Rails and I could answer any question you might have regarding the implementation. Does that make sense?