Commit Graph

10570 Commits

Author SHA1 Message Date
Consul Bot
d2388dec54 New translations moderation.yml (Albanian) 2018-11-06 13:12:17 +01:00
Consul Bot
bc7be0ee7b New translations kaminari.yml (Swedish) 2018-11-06 13:10:38 +01:00
Consul Bot
c17b739068 New translations community.yml (Swedish) 2018-11-06 13:10:37 +01:00
Consul Bot
d173e39abb New translations social_share_button.yml (Swedish) 2018-11-06 13:10:36 +01:00
Consul Bot
b1e77e07c6 New translations valuation.yml (Swedish) 2018-11-06 13:10:34 +01:00
Consul Bot
f03f8f529f New translations verification.yml (Swedish) 2018-11-06 13:10:33 +01:00
Consul Bot
db7c8cc915 New translations activemodel.yml (Swedish) 2018-11-06 13:10:32 +01:00
Consul Bot
f1cd3f3713 New translations mailers.yml (Swedish) 2018-11-06 13:10:31 +01:00
Consul Bot
c2ca684409 New translations devise_views.yml (Swedish) 2018-11-06 13:10:30 +01:00
Consul Bot
137c16a68b New translations pages.yml (Swedish) 2018-11-06 13:10:29 +01:00
Consul Bot
078ae17cff New translations devise.yml (Swedish) 2018-11-06 13:10:28 +01:00
Consul Bot
73e6639d28 New translations budgets.yml (Swedish) 2018-11-06 13:10:27 +01:00
Consul Bot
6e9cc6972f New translations moderation.yml (Swedish) 2018-11-06 13:10:26 +01:00
Consul Bot
daf850d42b New translations rails.yml (Swedish) 2018-11-06 13:10:25 +01:00
Consul Bot
c7c9c42b58 New translations activerecord.yml (Swedish) 2018-11-06 13:10:22 +01:00
Consul Bot
3c5642004d New translations admin.yml (Spanish) 2018-11-06 13:09:24 +01:00
Consul Bot
e3a88a7b05 New translations activerecord.yml (Spanish) 2018-11-06 13:09:17 +01:00
Consul Bot
afa26f4df5 New translations rails.yml (Albanian) 2018-11-06 13:06:43 +01:00
Raimond Garcia
e6f8814c28 Merge pull request #2998 from consul/i18n-uptade-crowdin
Update i18n from Crowdin
2018-11-06 12:54:46 +01:00
voodoorai2000
f79f219f2c Fix date translations 2018-11-06 11:42:51 +01:00
decabeza
cb2b2ac965 Merge branch 'master' into i18n-uptade-crowdin 2018-11-05 19:07:37 +01:00
voodoorai2000
f4c35eb948 Add one more PR to Changelog 2018-11-05 18:20:51 +01:00
voodoorai2000
160ca317c5 Update version number for consul.json 2018-11-05 18:20:51 +01:00
decabeza
79e1ec444c Fixes houndci-bot warnings 2018-11-05 18:20:51 +01:00
decabeza
a218f8cced Improves some code format details 2018-11-05 18:20:51 +01:00
voodoorai2000
54950d14c9 Add Changelog for release 0.17 2018-11-05 18:20:51 +01:00
Javi Martín
745c9cd72b Don't check already present page content
The content 'An example legislation process' is already present before
we click the "All" link.

Not checking the page content properly sometimes resulted in the second
click being executed before the first request had been completed, making
the spec fail.

By checking the "All" link isn't present anymore, we guarantee the
request has been completed before trying to click the 'An example
legislation process' link.
2018-11-05 18:20:51 +01:00
decabeza
1a15cb6a42 Refactors social meta tags spec 2018-11-05 18:20:51 +01:00
decabeza
816f0c55c0 Adds new social share partial for proposals 2018-11-05 18:20:51 +01:00
voodoorai2000
ac7d1ebf27 Increase delayed jobs max run time 2018-11-05 18:20:50 +01:00
voodoorai2000
bfe9ae6ab0 Add counter of emails sent to newsletter preview 2018-11-05 18:20:50 +01:00
Javi Martín
a8d2fbab57 Remove described class cop
We've agreed `User.new` is easier to read than `described_class.new` and
since we are ignoring Hound's comments regarding this topic, we might as
well remove it.
2018-11-05 18:20:50 +01:00
Javi Martín
dc13533371 Make Capybara check the page between comment votes
As pointed out in PR consul#2734:

"After clicking the first link, there's an AJAX request which replaces
the existing `.in-favor a` and `.against a` links with new elements. So
if Capybara tries to click the existing `.against a` link at the same
moment it's being replaced, clicking the link won't generate a new
request".

Making Capybara check the page for new content before clicking the
second link solves the problem.

This commit solves issues afecting both Madrid's fork and the original
CONSUL repo.
2018-11-05 18:20:50 +01:00
Javi Martín
a7a9355a58 Enable SCSS rules in Hound 2018-11-05 18:20:50 +01:00
Javi Martín
6a42f6fee2 Add basic rubocop configuraton for Hound
This way we can ask contributors to follow some basic guidelines like
removing trailing whitespaces while not overwhelming them with all our
rules.
2018-11-05 18:20:50 +01:00
Javi Martín
bf79ddb858 Remove rubocop_todo file
No developers are maintaining it anymore.
2018-11-05 18:20:50 +01:00
Javi Martín
70195a1c91 Fix bug with non-underscored locales
Ruby can't have hyphens in method names, so sending something like
`record.title_pt-BR` would raise an exception.

Using globalize's `localized_attr_name_for` method fixes the bug.

Thanks Marko for the tip.
2018-11-05 18:20:50 +01:00
Javi Martín
adf03b9e1b Don't abort the migration if the simulation fails
We think aborting the migration will generate more headaches to system
administrators, who will have to manually check and fix every invalid
record before anything can be migrated.
2018-11-05 18:20:50 +01:00
Javi Martín
10b0d8232d Add task to simulate data migration
This way we can check everything is OK before actually migrating the
data to the translations tables.
2018-11-05 18:20:50 +01:00
Javi Martín
9b671a8132 Log failed data migrations
In theory, it should never happen, but that's why exceptions exist.
2018-11-05 18:20:50 +01:00
Javi Martín
b9906209ea Use migrate_data option for globalize
This way the task to migrate the data doesn't have to be run manually if
these migrations weren't already executed.
2018-11-05 18:20:50 +01:00
Javi Martín
232d5b0edd Migrate custom pages data to their locale 2018-11-05 18:20:50 +01:00
Javi Martín
c774ae67a0 Add task to migrate data to translation tables
We forgot to do it when we created the translation tables, and so now we
need to make sure we don't overwrite existing translations.
2018-11-05 18:20:50 +01:00
Javi Martín
c9fadc7c3d Fix poll question with non-underscored locales
Ruby can't have hyphens in method names, so sending something like
`title_pt-BR=` would raise an exception.
2018-11-05 18:20:50 +01:00
Javi Martín
8f4d600b47 Fix spec assuming German isn't available
Since we've recently added German to the available languages, and we
might support every language in the future, we're using the fictional
world language to check a locale which isn't available.

Another option could be to set the available locales in the test
environment (or the rspec helper), but then we'd have to make sure it's
executed before the call to `globalize_accessors` in the model, and it
might be confusing for developers.
2018-11-05 18:20:50 +01:00
Javi Martín
0f759f1e16 Extract method to render form fields for a locale 2018-11-05 18:20:50 +01:00
Javi Martín
c8d3c8fc1b Use detect instead of select.first 2018-11-05 18:20:50 +01:00
Javi Martín
b745ddc9dd Simplify code checking whether to enable a locale 2018-11-05 18:20:50 +01:00
Javi Martín
7f5f144837 Don't run specs if there are custom fallbacks
This spec depends on French falling back to Spanish and was failing on
forks using a different fallback.
2018-11-05 18:20:50 +01:00
Javi Martín
0c1228a7ce Fix crash with no translation for default locale
When we were visiting a page showing the content of a record which uses
globalize and our locale was the default one and there was no
translation for the default locale, the application was crashing in some
places because there are no fallbacks for the default locale.

For example, when visiting a legislation process, the line with
`CGI.escape(title)` was crashing because `title` was `nil` for the
default locale.

We've decided to solve this issue by using any available translations as
globalize fallbacks instead of showing a 404 error or a translation
missing error because these solutions would (we thinkg) either require
modifying many places in the application or making the translatable
logic even more complex.

Initially we tried to add this solution to an initializer, but it must
be called after initializing the application so I18n.fallbacks[locale]
gets the value defined in config.i18n.fallbacks.

Also note the line:

fallbacks[locale] = I18n.fallbacks[locale] + I18n.available_locales

Doesn't mention `I18n.default_locale` because the method
`I18n.fallbacks[locale]` automatically adds the default locale.
2018-11-05 18:20:50 +01:00