question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

i18n ally not working with the Ruby on Rails framework (doesn't detect framework & annotations don't work)

See original GitHub issue

Doesn’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.

  1. 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.

  1. Create a post section with db migration using rails generators (scaffolding) rails g scaffold posts title body
  2. Run the migration rails db:migrate
  3. 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 Bildschirmfoto 2020-12-29 um 09 14 45

Bildschirmfoto 2020-12-29 um 09 17 47

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
fydeliocommented, Jan 7, 2021

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.

After developing your application for a while, check in the application together with the Gemfile and Gemfile.lock snapshot. Now, your repository has a record of the exact versions of all of the gems that you used the last time you know for sure that the application worked…

This is important: the Gemfile.lock makes your application a single package of both your own code and the third-party code it ran the last time you know for sure that everything worked. Specifying exact versions of the third-party code you depend on in your Gemfile would not provide the same guarantee, because gems usually declare a range of versions for their dependencies.

2reactions
fydeliocommented, Jan 7, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

i18n ally not working with the Ruby on Rails framework (doesn ...
i18n ally not working with the Ruby on Rails framework (doesn't detect framework & annotations don't work) #455.
Read more >
ruby on rails - Why my i18n doesn't work? - Stack Overflow
I believe locales should only have the main language (in your case zh ) without the region. Rename your file locales/devise.zh.yml and set ......
Read more >
Code[ish] - Heroku
According to Innocent, the absence of crash reports does not mean that software is performing well. Software can work - but not be...
Read more >
YAML for localization
Configure formatting at the IDE level in Preferences | Editor | Code Style | YAML. Unsupported formats. Request support at i18n-ally@lokalise.com. Arrays are ......
Read more >
The Great Divide - CSS-Tricks
Let's say there is a divide happening in front-end development. I feel it, but it's not just in my bones. Based on an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found