We work with many languages using Crowdin[1]
Sometimes translators forget to fill in all the necessary plural forms of a translation (zero, one, other) and in those cases we were seing the exception InvalidPluralizationData being raised
There are a number of approches to fix this... from being more strict when approving translations, to automatically extrapolating what those plural forms should be
For now, we've gone for a simple approach to display the actual count(0,1,2,3,4, etc) instead of the whole translation
So, if the plural form of "1 comment" is missing, just a "1" will be displayed and no exceptions raised
Note: The first two specs, test what is really Rails' functionalities. However as we are monkey patching the pluralize method, I thought it was appropriate to doble check it
[1]https://crowdin.com/project/consul
By doing so and including it in ActionDispatch::Routing::UrlFor, we make
it available in controllers, helpers and specs, and so we can remove the
duplication we had there with methods dealing with the same problem.
Even if monkey-patching is ugly, using a different module and executing
ActionDispatch::Routing::UrlFor.send(:include, MyModule) wouldn't make
the method available in the controller.
We can use the `config.authorize_with` option, so we don't need to copy
the controller in order to load and authorize resource.
Besides, only administrators can upload images, so we don't need to
track the image's user id.
Just so we can navigate throught git history faster:
* Introduced in 345e34d to avoid precompiling all CKEditor assets.
* Modified in 54c82a5 to avoid compiling assets during tests.
* Overwritten by `rails g ckeditor:install` in c0d6c0b.
After creating a translation in spanish, it was also displaying it when selecting
the english locale.
This was due to the code picking the first translation available
With this commit, we are checking for an existing translation in the current locale
and displaying it if it exists
As stated in #1196, compiling everything related to CKEditor made
compilations slower. However, not compiling any plugins meant Travis had
to compile them while running a test. It often resulted in a test
failing because the time Travis took to compile the plugins the
application uses exceeded Capybara's wait time.
Why:
* Crowdin now hosts all consul translations publicly so anyone can contribute https://crowdin.com/project/consul/invite
* Crowdin makes easy for non-tech people to contribute, once we have a demo site we'll be able to offer "on site" translation
* If you still use Tolk, we recommend removing this commit (but adding tolk gem to ./Gemfile_custom file to avoid future merge conflicts)
How:
* Reverting changes introduced with 9610a6a933