Commit Graph

9760 Commits

Author SHA1 Message Date
rgarcia
4c8b174274 Display only translations for the current language
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
2018-07-26 21:55:07 -04:00
rgarcia
12f6f06ade Fix exception when using locale as a parameter in the url
When visiting, for example, /admin/site_customization/information_texts?locale=fr
we were getting an `UncaughtThrowError: uncaught throw :exception`
With the following payload
```
File "/aytomad/app/participa/participacion/releases/20180726231929/app/views/admin/site_customization/information_texts/_form_field.html.erb" line 5

File "/aytomad/app/participa/participacion/releases/20180726231929/app/helpers/globalize_helper.rb" line 35 in block in globalize
```

Substituting this line seems to solve it

Note that we had to remove the portuguese local too, as it was giving a different
exception due to this change. This problem, has been solved in the original
globalization PR
2018-07-26 21:55:06 -04:00
Angel Perez
a943c24aa7 Replace Madrid-specific texts with CONSUL ones 2018-07-26 21:13:53 -04:00
Angel Perez
8015596cb8 Replace hardcoded update notice when updating translations with proper I18n 2018-07-26 20:49:12 -04:00
Angel Perez
1255389ef7 Remove redundant translation specs 2018-07-26 20:49:12 -04:00
Angel Perez
26deb02937 Show I18n key on label instead of translation 2018-07-26 20:49:12 -04:00
rgarcia
461a172bd2 Refactor translations loading for current locale 2018-07-26 20:49:01 -04:00
rgarcia
feb3df1f93 Initialize I18n.backend translations
We were getting a 500 error because the translations had not been initialized
https://stackoverflow.com/a/4054527
2018-07-26 20:49:00 -04:00
rgarcia
78a5c0356e Add globalization javascript interface specs 2018-07-26 20:49:00 -04:00
Angel Perez
9c74fa393d Translations can be removed 2018-07-26 20:49:00 -04:00
Angel Perez
ad252ca835 Translations can be updated correctly 2018-07-26 20:49:00 -04:00
rgarcia
82f496ccfa Fix globalization for information texts
Refactoring and making similar specs to the milestones globalization specs
2018-07-26 20:48:56 -04:00
Angel Perez
113981c573 Avoid unnecessary DB call on I18nTranslation initializer 2018-07-26 19:09:36 -04:00
Angel Perez
0e82fa72a2 Do not translate original I18n value on label 2018-07-26 19:09:01 -04:00
Angel Perez
079124e3dd Show current translation or I18n value for locale on textarea 2018-07-26 19:08:50 -04:00
Angel Perez
42eb784922 Add specs for basic Admin Globalize feature 2018-07-26 19:08:42 -04:00
Angel Perez
4c2eedf8bd Add French I18n keys for InformationTexts#index view 2018-07-26 19:08:29 -04:00
Angel Perez
dd42b7ffbd Correctly highlight 'Custom information texts' option on menu if active 2018-07-26 19:08:02 -04:00
Angel Perez
277fb95f1c Remove unnecessary I18n YAML files 2018-07-26 19:07:53 -04:00
Angel Perez
7255c6cb9b Fallback to default I18n value if translation is not available 2018-07-26 19:07:47 -04:00
rgarcia
f521188cd0 Fix specs with recently updated I18n values 2018-07-26 19:07:38 -04:00
Angel Perez
b8b0f64e64 Rename emails key with mailers key 2018-07-26 19:07:28 -04:00
Angel Perez
ca57a65aae Add missing I18n keys for InformationTexts#index view 2018-07-26 19:07:22 -04:00
Angel Perez
5c1e0bd949 Don't use hardcoded locale when appending/creating I18n keys 2018-07-26 19:07:11 -04:00
Angel Perez
983dcf0247 Move 'Custom information texts' menu option under 'Site content' 2018-07-26 19:07:04 -04:00
Angel Perez
a190e3e1e0 Fix exception for undeclared variable on InformationTexts#index action 2018-07-26 19:06:54 -04:00
Angel Perez
bc152acaf2 Don't evaluate a conditional and assign a variable on the same line 2018-07-26 19:06:44 -04:00
Angel Perez
f92006b3f3 Extract complex logic from InformationTexts#index into separate private methods 2018-07-26 19:06:37 -04:00
Angel Perez
26965b43ee Clean I18n codebase 2018-07-26 19:06:29 -04:00
Raúl Fuentes
6d6dc32c38 Complete basic I18n backend and frontend 2018-07-26 19:06:19 -04:00
Raúl Fuentes
c18479e3ac Add translations management pages
In the admin section of the application, a new page
has been added so that the admins are able to manage
the selected texts for translate.

The texts have been divided in different "sections",
depending on the nature of themselves (budgets, polls,
proposals, management, etc.). Each section has become a tab
with a form associated to edit all the texts for her.

When a language is added, it's added for ALL the texts in the
application. That means that, if an admin adds french for debates,
the french form will appear for the rest of the texts. That doesn't
mean that they need to fill all the texts, only that the languages
work for all of them instead of individually.
2018-07-26 19:05:58 -04:00
Ziyan Junaideen
ffe7465b86 Spec adjustments 2018-07-26 22:55:49 +05:30
Ziyan Junaideen
9bad639bb5 i18n usage - typo + sub navigation using new keys 2018-07-26 22:55:49 +05:30
Ziyan Junaideen
a6bbf32b8e Content blocks - new keys 2018-07-26 22:55:49 +05:30
Ziyan Junaideen
a37b64dfb6 i18n desc for content block known keys + use in select in form 2018-07-26 22:55:49 +05:30
Ziyan Junaideen
494493214c Revert "Hiding help if there is a left/right content block"
This reverts commit 6eeb7bfdaef9d370892fe0cc03635b45b29e2036.
2018-07-26 22:55:49 +05:30
Ziyan Junaideen
33c1aaeb71 Content blocks spec 2018-07-26 22:55:49 +05:30
Ziyan Junaideen
4ee2c20253 Hiding help if there is a left/right content block 2018-07-26 22:55:49 +05:30
Ziyan Junaideen
7fb4d10989 Not showing top links if content block exist 2018-07-26 22:55:49 +05:30
Ziyan Junaideen
5b6a6b5324 Changed keys for locations 2018-07-26 22:55:49 +05:30
Ziyan Junaideen
1c818850d2 Content blocks for navigation 2018-07-26 22:55:49 +05:30
Ziyan Junaideen
b95aa5d912 Sub nav content positions 2018-07-26 22:55:49 +05:30
Alberto
4be40b9e5d Merge pull request #2802 from consul/newsletter-delivery
Newsletter delivery
2018-07-26 18:20:50 +02:00
decabeza
69d67940d3 Removes unnecesary scope 2018-07-26 17:55:06 +02:00
decabeza
786a3949fd Moves moderate_system_email from private method 2018-07-26 17:55:06 +02:00
María Checa
9d580e15f5 Adds activity tab for system emails 2018-07-26 17:55:06 +02:00
María Checa
f1e7b634ba Adds moderate actions to proposal system notifications 2018-07-26 17:55:06 +02:00
María Checa
3cc8b1d123 Removes rake task to send proposal notifications
This action will be performed manually by admin users from the `admin/system_emails` view.
2018-07-26 17:55:06 +02:00
María Checa
eb8c021451 Adds button to send pending proposal notifications 2018-07-26 17:55:06 +02:00
decabeza
d58941ef9c Updates text on notifications spec 2018-07-26 17:55:06 +02:00