Any suggestion for Ruby on Rails multilingual translation management? - ruby-on-rails

I am developing a Ruby on Rails application with multilingual support. Now I have 4 languages, each have a separate yml file. I found this is inconvenience that when I add a new translation, I need to add all the lines manually to each yml file.
Does any good translation management tools can help me on this?
Thanks everyone. :)

Here are some links that I've gathered
Free (gems)
https://github.com/firmafon/iye IYE makes it easy to translate your Rails I18N files and keeps them up to date
https://github.com/tolk/tolk Tolk is a web interface for doing i18n
translations packaged as an engine for Rails 4 applications
https://github.com/local-ch/i18n-docs Maintain translations in Google
Docs and export them to your Rails project.
https://github.com/mynewsdesk/translate A Ruby on Rails plugin with a
web interface for translating I18n texts
https://github.com/mose/rails-i18nterface A rails 3/4 engine based
interface for translating and writing translation files
https://github.com/fourmach/i18n_dashboard Rails Engine for I18n
management with redis as backend
https://github.com/grosser/fast_gettext Ruby GetText, but 3.5x faster
... https://github.com/copycopter/copycopter-server /
http://copycopter.com Copycopter Server is open source. Run it as a
web service.
https://github.com/nijel/weblate / http://weblate.org/
/ Web based translation tool with tight Git integration.
Paid (apps)
http://www.tr8nhub.com/pricing (starting free - https://github.com/tr8n/tr8n)
https://www.localeapp.com/pricing (24€/month)
https://translationexchange.com/pricing ($39/month)
https://phraseapp.com/ ($9/month /language/project)
more advices http://eng.joingrouper.com/blog/2014/04/03/rails-internationalization-translation/
http://www.smartling.com/product (Contact Sales - complex)

Personally I'm using http://99translations.com/ Easy to use for non-programmers, eg. translators and free for the open source projects.
Another service https://webtranslateit.com/ is growing and in active development (blog is updating frequently). They have also free plan, on which you can store up to 500 strings, even for non open source project.
Both have API, for which they have rake task to update translations on your local machine and also on their server. Actually never used, but I think it's good when you have > than 1000 strings and updates are frequent.

Tolk can help you to do that: http://github.com/tolk/tolk

You can try using Translate to edit YML files.

There's https://github.com/berk/tr8n but it looks pretty hard core and it focuses more on the front end crowdsourcing component.

Related

How to automate rails project "bootstrap" consolidating routine customizations?

As we create more Rails applications, I find myself routinely adjusting the project generated by rails new ... in exactly the same ways: adding rspec, capybara + capybara-webkit support, adjusting config/application.rb to our tastes, including several gems we came to love.
I had a look at suspenders, it's a good starting point, but some of their choices differ from ours. Plus it's flexible in places where we don't really want any choice. In fact we'd rather have a couple project boilerplates sharing some customizations and each adding some unique extra's.
What are the options for streamlining/automating a project "bootstrap"? How could we organize a set of boilerplates and let them evolve as our preferences change (not adding options, but changing which made choices are hardcoded)?
I'm thinking in the direction of scripting what I normally do manually starting from rails new, editing the Gemfile, config/application.rb etc, but may be there is a cleaner (future versions compatible) approach or tool?
I really like using the Rails Composer gem/tool for this.
At the basic level when you run Rails Composer it will ask you a series of questions about what gems/configuration options you'd like your new Rails app to have. Then generates your app for you.
I like the "ask me for what I want" approach because different Rails projects may need different things: Postgres vs MySQL, Bootstrap vs Zurb Foundation, etc. 90% of these are usually the same, but it's the 10% difference that gets me.
At the more advanced level, Rails Composer shows you how to use Rails templates to create your own standard modifications, or you could fork Rails Composer to add the options you want (maybe sending a PR back to the project if it's something useful?)
At the expert level, Rails Composer has "starter apps": just pick one of those and go, choices already made for you. Depending on your needs this might be just the kind of thing you're looking for -- digging into how these "starter" apps are created and making one yourself.

Ruby on Rails: what is the best choice of Web UI for managing I18n yml files?

I want to grant to external people possibility to change translation in my project. I want to use web interface for it. And I want all this changes to be git commited. And, if it possible, I want to see authors of changes, so in the best case this web ui should have users and it's own authorization system.
I found question Is there a web UI for modifying I18n locales for Rails 3?, but this isn't satisfy all conditions (like git for example or different users).
So it would be great if you pointing such Web UIs to me.
P.S. I use Rails 3
Rails Translation Center Gem is awesome! https://github.com/BadrIT/translation_center
It is free; you don't need to pay for such locale or phrase!
We are using https://webtranslateit.com/ with our Rails 3 project.
It has users, translator groups etc. and works pretty well. It can read the changes of the translation files from git, but it cannot commit automatically back. However, for us that has not been a problem as when there are updated translations some of the developers can easily do a "WTI pull" to get newest translations, check that nothing is broken and make a git commit of those.
It seems like the translate app would do what you want, just add git commits to it. There's a storage module. Fork the repo, add git functionality using the ruby-git gem. Make a git commit call after the yml file is written. You'll have to hook the commit.author.name and commit.author.email to your authorization system in Rails to make it "multi-user".
Should be a fun little project.
You can use locale or phrase. They are both free in beta.
Alternatively, you can setup your own translation web service with copycopter.

Preferable way to distribute a Rails app

Although Rails and PHP have different deployment methods, what is the preferable way to distribute a FOSS Rails app? Suppose one of the major PHP apps - Magento, Drupal, Wordpress had been build upon RoR, what would have been the preferable way for them to have distributed their application?
Packaging up the code as a gem seems to be the wrong approach for a complete out-of-the-box application, but I could be wrong.
Coming from the world of PHP with its upload-and-go approach, and being a newcomer to Rails, it's rather opaque at the moment to see how code could be easily and effectively distributed.
Packaging a completed Rails app as a gem is probably the wrong approach. I think the best solution is to provide access to a git repository or a tarball of your git repo.
If you want to offer your users something more than rake db:schema:load to setup your app it's pretty easy to create custom setup commands.
Many applications are packaged with the source code just like typical PHP applications. While deploying Rails applications may seem difficult its expected that the user will know how to set up the server properly according to their environment and needs. The only issue you need to worry about is distributing the code, setting up the server is not a domain that you are going to want to help with.
For information on deployment in Rails you should see the deployment page here.
Well, usually Rails apps run in environment running Apache + Passenger (aka mod_rails).
Deployment is easily done with Capistrano gem.
When you're running Rails app in shared host environment, they usually use fcgi/cgi dispatchers to run Ruby.

Compiling / building ruby online from a working rails application

I'm totally new to Ruby but not to programming. All I did was going through try ruby and reading differences from other few languages I know better (mostly PHP and some Python). So I have no idea how Rails differ from Ruby and maybe this is an absurd question.
Anyways...
I don't want (or am able) to install Ruby on my machine and I'd still like to build a single working source file. Is it possible to have an online compiler of some sort? If so, how?
If I write a Rails web site (comprised of either one or many files) using any given host (that far I know I can), would I be able to use that same code with very minor modifications and just run as a Ruby app? Again, how?
(new) What about the other way around: a Ruby app turning into a Rails web page? Easy to do?
I really hope for a "yes" on them all, but I doubt on the 1st and not so much on the last. :)
There are online "IDEs" you can use to try out ruby:
http://ideone.com
http://codepad.org
But mind you that Ruby on Rails is a framework written in Ruby and those sites don't have RoR installed. Also note you that a Rails app has many, many files.
If you have the same code and same server configuration (version of ruby, database, plugins, etc.) you should only need minor modifications to the config file.
Ruby on Rails is on Ruby. So whatever works on Ruby should work just fine on RoR with minor modifications. However, you'll probably want to rewrite the app to take advantage of many of the features RoR provides.

Is Ruby on Rails suitable for a non-web application?

I am interested in developing a workstation-based application that communicates with a proprietary data server and that presents information from that server to the user. I am not intending the user interface to be browser-based, and have been considering Qt as my framework. Should I consider RoR for this? Thanks.
Rails is specifically a web application framework, however there are GUI toolkits that can be used with Ruby, including Qt (although not the open source version).
Rails is a web framework, so you should not use it. However, you should absolutely consider using Ruby. I've never used Ruby with Qt, but I've had a lot of success using JRuby with Swing. I use the Profligacy gem, which suits my needs quite well.
Being a web framework you may not use rails, but you may certainly use some parts of rails.
For example just use require 'active_record' and you instantly have access to AR and all its magic - validations, belongs_to, has_many and other similar associations.
You can use the ActiveRecord part of Ruby on Rails, which for a long time was the most interesting part of RoR. https://edgeguides.rubyonrails.org/active_record_basics.html
Alternatively, use another Ruby ORM, like DataMapper: http://datamapper.org/
The answer is yes. I've been working on a project, Qt on Rails, which combines Qt with a Rails back end. The end result is that you can develop your Qt app's in Ruby, harness the libraries of Rails and there's support for scaffolding of apps as well.
It’s still a 'Work In Progress' but the current latest version at the Qt on Rails github repository (http://github.com/theirishpenguin/qtonrails) will certainly give a flavour of where the project is headed. Contributors and feedback is most welcome and detailed blog post is available on the project.

Resources