Commit Graph

2984 Commits

Author SHA1 Message Date
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
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
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
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
Javi Martín
1ab3b7f42d Don't force translations for the current locale
Globalize creates a translation for the current locale, and the only way
I've found to change this behaviour is to monkey-patch it.

The original code uses `translation.locale` instead of
`Globalize.locale`. Since `translation.locale` loads the translation
with empty attributes. It both makes the record invalid if there are
validations and it makes it almost impossible to create a record with
translations which don't include the current locale.

See also the following convertations:

https://github.com/globalize/globalize/pull/328
https://github.com/globalize/globalize/issues/468
https://github.com/globalize/globalize/pull/578
https://github.com/shioyama/mobility/wiki/Migrating-from-Globalize#blank-translations
2018-11-05 18:20:50 +01:00
Javi Martín
981b13ac9b Update widget cards translatable fields 2018-11-05 18:20:50 +01:00
Javi Martín
e400cb8eae Update site customization pages translatable fields 2018-11-05 18:20:50 +01:00
Javi Martín
e9a5f03089 Update poll question answers translatable fields
We needed to bring back support for CKEditor in our translatable form,
which we had temporarily remove.

And now we support CKEditor in our translatable specs, and so we can
remove the duplicated specs for poll question answers.
2018-11-05 18:20:50 +01:00
Javi Martín
292609e7ac Update poll questions translatable fields
We need to replace ".title=" by ".title_#{locale}=" in one place because
for some reason globalize builds a new translation record when using the
latter but it doesn't build one when using the former.
2018-11-05 18:20:25 +01:00
Javi Martín
6478bb70c2 Update polls translatable fields
The `:name` attribute is still allowed in the controller because some
forks use it when creating a poll from a budget.
2018-11-05 18:20:25 +01:00
Javi Martín
9c5a7c58a7 Update legislation process translatable fields 2018-11-05 18:20:25 +01:00
Javi Martín
968a5b11d3 Update legislation drafts translatable fields
Updating it required reorganizing the form so translatable fields are
together.

We also needed to add a `hint` option to the form label and input
methods so the hint wouldn't show up for every language.

Finally, the markdown editor needed to use the same globalize attributes
as inputs, labels and hints, which adds a bit of duplication.
2018-11-05 18:20:25 +01:00
Javi Martín
d40cd3995d Update admin notifications translatable fields
The same way we did for banners.

We needed to add new translation keys so the labels are displayed in the
correct language. I've kept the original `title` and `body` attributes
so they can be used in other places.

While backporting, we also added the original translations because they
hadn't been backported yet.
2018-11-05 18:19:50 +01:00
decabeza
c80e436614 Removes guide feature 2018-11-05 18:19:50 +01:00
voodoorai2000
2c34a8b4e2 Remove fallback rules for locales not yet added 2018-11-05 18:19:50 +01:00
voodoorai2000
56e85ff692 Remove duplicate language names 2018-11-05 18:19:50 +01:00
voodoorai2000
9fcd2598c1 Add fallback i18n locales
All other languages will fallback to the default locale

Rails also, seems to pick up dialect fallbacks, for locales with this format: es-CO, es-PE, etc, which will fallback to "es", so that is great 😌
2018-11-05 18:16:58 +01:00
voodoorai2000
df32a5407f Add all available locales
Only addding those with significant number of translations
2018-11-05 18:16:58 +01:00
voodoorai2000
5117f3eb37 Add all language names 2018-11-05 18:16:58 +01:00
voodoorai2000
b49b20a6bb Fix locale folder names
There seems to be some differences between the folder name and the locale name used in the files themselves.

For example: the folder might have been called "de-DE", for German, but the files use one "de"

And thus translations where not being displayed

Using the locale key in the files and modifying the folder name if neccesary, let's see what happens in the next Crowdin pull, might need to review more thoroughly why this is happening (maybe due to custom settings in Crowdin)
2018-11-05 18:05:49 +01:00
Consul Bot
3bd19b2046 New translations general.yml (Spanish, El Salvador) 2018-11-05 17:41:38 +01:00
Consul Bot
93c53520a1 New translations mailers.yml (Spanish, El Salvador) 2018-11-05 17:41:34 +01:00
Consul Bot
90fec25489 New translations general.yml (Spanish, El Salvador) 2018-11-05 16:11:29 +01:00
Consul Bot
8e6922de9f New translations devise.yml (Spanish, El Salvador) 2018-11-05 16:11:25 +01:00
Consul Bot
86ebd64504 New translations rails.yml (Turkish) 2018-11-05 14:42:32 +01:00
Consul Bot
1db9022a25 New translations i18n.yml (Persian) 2018-11-05 14:42:31 +01:00
Consul Bot
6079c1f235 New translations i18n.yml (German) 2018-11-05 14:42:29 +01:00
Consul Bot
6c33f17fcb New translations rails.yml (Portuguese, Brazilian) 2018-11-05 14:32:09 +01:00
Consul Bot
a4f87553d4 New translations rails.yml (Polish) 2018-11-05 14:32:07 +01:00
Consul Bot
192d654d73 New translations rails.yml (Italian) 2018-11-05 14:32:05 +01:00
Consul Bot
e71d6ddfc5 New translations rails.yml (Indonesian) 2018-11-05 14:32:04 +01:00
Consul Bot
0b7730fcf6 New translations rails.yml (Galician) 2018-11-05 14:32:02 +01:00
Consul Bot
23a5ecdbf0 New translations rails.yml (Dutch) 2018-11-05 14:32:01 +01:00
Consul Bot
edea5c1ccb New translations rails.yml (Albanian) 2018-11-05 14:31:59 +01:00
Consul Bot
ec032728a7 New translations rails.yml (Spanish, Venezuela) 2018-11-05 14:22:36 +01:00