Commit Graph

130 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
26deb02937 Show I18n key on label instead of translation 2018-07-26 20:49:12 -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
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
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
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
9bad639bb5 i18n usage - typo + sub navigation using 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
decabeza
573a7e7c13 Moves content blocks info to index view 2018-06-08 18:45:45 +02:00
taitus
9b6b57a24c Remove all white spaces 2017-09-06 14:12:32 +02:00
María Checa
3e2cbabc9c Locales helper improvement
Added a rescue block in `name_for_locale()` to ensure the application doesn't crash in case it receives an invalid locale.
2017-07-03 12:55:22 +02:00
María Checa
6f24c68ab5 Improved pages index
Locale can be seen as text instead of the code.
2017-07-02 23:12:47 +02:00
María Checa
8894ec4f7c Pages form improvements
Added `locale` validation to model and improved its form select tag performance.
2017-07-02 21:28:13 +02:00
María Checa
720a2af046 Update pages controller and views
Added new attribute `locale` to pages index list and form.
2017-07-02 14:49:56 +02:00
decabeza
76b7f66fb3 fixes scss lint warnings 2017-06-16 12:09:01 +02:00
decabeza
c50147e4be adds callout message if there is no pages on admin pages 2017-06-07 18:29:00 +02:00
Alberto Garcia Cabeza
8cbf9f3c3d improves site customization layout, tables, i18n 2017-04-17 19:02:40 +02:00
Amaia Castro
9e5324cc1b Merge branch 'master' into site-customization 2017-04-07 17:29:33 +02:00
Fernando Blat
e126a2ded0 Add information about content blocks 2017-04-06 17:00:05 +02:00
Amaia Castro
c1de2dced4 Custom content blocks for top_links and footer 2017-04-06 17:00:05 +02:00
Amaia Castro
8143fe1037 Site customization: images uploads 2017-04-06 17:00:04 +02:00
Amaia Castro
54fab919e5 Show custom pages in public site 2017-04-06 16:59:58 +02:00
Amaia Castro
255b57cc85 Admin for custom pages 2017-04-06 16:25:07 +02:00