Commit Graph

5105 Commits

Author SHA1 Message Date
Consul Bot
da27bd417a New translations budgets.yml (Russian) 2018-10-25 11:50:35 +02:00
Consul Bot
1cdfb50632 New translations budgets.yml (Russian) 2018-10-25 11:48:36 +02:00
Consul Bot
b8404f027d New translations budgets.yml (Russian) 2018-10-25 11:42:34 +02:00
Consul Bot
51068dfd8e New translations budgets.yml (Russian) 2018-10-25 11:20:46 +02:00
Consul Bot
2ad456fb19 New translations budgets.yml (Russian) 2018-10-25 11:06:34 +02:00
Consul Bot
d93719da46 New translations budgets.yml (Russian) 2018-10-25 10:50:47 +02:00
Consul Bot
5888e6d6d3 New translations budgets.yml (Russian) 2018-10-25 10:40:55 +02:00
Consul Bot
4b9ed6c041 New translations budgets.yml (Russian) 2018-10-25 10:31:06 +02:00
Consul Bot
89bf1aeefc New translations budgets.yml (Russian) 2018-10-25 10:20:50 +02:00
Consul Bot
fddc632519 New translations budgets.yml (Russian) 2018-10-25 10:10:53 +02:00
Consul Bot
64d181cac3 New translations activerecord.yml (Valencian) 2018-10-25 09:27:19 +02:00
Consul Bot
3d0dbcdf3e New translations settings.yml (Chinese Simplified) 2018-10-25 04:30:36 +02:00
Consul Bot
ad0dfad5e0 New translations settings.yml (Chinese Simplified) 2018-10-25 04:20:27 +02:00
Consul Bot
cb45c7d907 New translations seeds.yml (Chinese Simplified) 2018-10-25 04:10:25 +02:00
Consul Bot
dea96894f6 New translations settings.yml (Chinese Simplified) 2018-10-25 04:10:23 +02:00
Consul Bot
a77b930af1 New translations seeds.yml (Chinese Simplified) 2018-10-25 04:00:27 +02:00
Consul Bot
4ae0f37d41 New translations responders.yml (Chinese Simplified) 2018-10-25 04:00:26 +02:00
Consul Bot
2557852830 New translations responders.yml (Chinese Simplified) 2018-10-25 03:56:51 +02:00
Consul Bot
9cd3c6e6d1 New translations rails.yml (Chinese Simplified) 2018-10-25 03:50:36 +02:00
Consul Bot
8e3b87638c New translations pages.yml (Chinese Simplified) 2018-10-25 03:30:31 +02:00
Consul Bot
2d8794d2c3 New translations rails.yml (Chinese Simplified) 2018-10-25 03:30:29 +02:00
Consul Bot
cc44ecc364 New translations pages.yml (Chinese Simplified) 2018-10-25 03:20:26 +02:00
Consul Bot
487ec20f49 New translations pages.yml (Chinese Simplified) 2018-10-25 03:10:25 +02:00
Consul Bot
5246839ca5 New translations pages.yml (Chinese Simplified) 2018-10-25 02:59:55 +02:00
Consul Bot
8b9a462b7a New translations pages.yml (Chinese Simplified) 2018-10-25 02:50:29 +02:00
Consul Bot
f52810219a New translations pages.yml (Chinese Simplified) 2018-10-25 02:35:08 +02:00
Consul Bot
6791ffd723 New translations pages.yml (Chinese Simplified) 2018-10-25 02:28:28 +02:00
Consul Bot
f49773ba45 New translations pages.yml (Chinese Simplified) 2018-10-25 02:20:57 +02:00
Consul Bot
2f8d705ee2 New translations pages.yml (Chinese Simplified) 2018-10-24 00:40:42 +02:00
Consul Bot
252991de37 New translations moderation.yml (Chinese Simplified) 2018-10-24 00:40:40 +02:00
Consul Bot
5fb40f929f New translations moderation.yml (Chinese Simplified) 2018-10-23 17:50:56 +02:00
Consul Bot
f2c7fe787a New translations pages.yml (Chinese Simplified) 2018-10-23 02:10:32 +02:00
Consul Bot
8293dcf0ad New translations pages.yml (Chinese Simplified) 2018-10-23 02:00:38 +02:00
Consul Bot
78e3e3f541 New translations pages.yml (Chinese Simplified) 2018-10-23 01:51:01 +02:00
Consul Bot
60b9be142b New translations pages.yml (Chinese Simplified) 2018-10-23 01:40:35 +02:00
Consul Bot
72392f6104 New translations pages.yml (Chinese Simplified) 2018-10-23 01:30:29 +02:00
Consul Bot
d268f9747d New translations pages.yml (Chinese Simplified) 2018-10-23 01:25:04 +02:00
Consul Bot
e3d3779395 New translations officing.yml (Chinese Simplified) 2018-10-22 20:50:44 +02:00
Consul Bot
96c2d4c295 New translations pages.yml (Chinese Simplified) 2018-10-22 20:50:43 +02:00
Javi Martín
2e6644d513 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-10-22 16:36:18 +02:00
Javi Martín
3b5a12b0ab 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-10-22 16:28:53 +02:00
Javi Martín
139cf769c6 Update widget cards translatable fields 2018-10-22 16:28:49 +02:00
Javi Martín
3c170f47d2 Update site customization pages translatable fields 2018-10-22 16:13:48 +02:00
Javi Martín
e0b9c1bfdd 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-10-22 16:13:48 +02:00
Javi Martín
d1249d0b4f 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-10-22 16:13:30 +02:00
Javi Martín
759de935ee 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-10-22 15:52:58 +02:00
Javi Martín
5bfc7ca2e3 Update legislation process translatable fields 2018-10-22 15:46:16 +02:00
Javi Martín
6278175f57 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-10-22 15:44:14 +02:00
Javi Martín
a326bcb0a1 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-10-22 15:43:56 +02:00
Consul Bot
047260b6c3 New translations moderation.yml (Chinese Simplified) 2018-10-22 03:10:54 +02:00