noosfero | WIP: Removes settings_item default value translation (!1089)
Gabriel Silva
gitlab at mg.gitlab.com
Wed Jan 18 10:37:36 BRST 2017
New Merge Request !1089
https://gitlab.com/noosfero/noosfero/merge_requests/1089
Project:Branches: gabrielssilva/noosfero:show_person_wall to noosfero/noosfero:master
Author: Gabriel Silva
Assignee:
Closes #241
`wall_access` uses a default `users` value. However, the current `settings_item` implementation translates String default values for some reason with the following code snippet.
```ruby
if not val.nil? then val elsif default.is_a? String then gettext default else default end
```
When using Noosfero in a language that translates the `users` String, the profile wall may not appear, as it will not be considered in the `AccessLevel` conditions.
Maybe we can keep the settings_item translation using another solution (like set the value in `after_save` instead of using a default value), but the bug can happen again in the future. Anyway, we can always translate the value manually. E.g.:
```ruby
settings_items :a_translated_setting, :type => :string, :default => _('some string')
```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170118/00bcda78/attachment.html>
More information about the Noosfero-dev
mailing list