[Git][noosfero/noosfero][master-1.x] 2 commits: signup: proper translation of terms of use error message

Leandro Nunes gitlab at mg.gitlab.com
Wed May 9 17:56:04 BRT 2018


Leandro Nunes pushed to branch master-1.x at Noosfero / noosfero


Commits:
59577f3b by Rodrigo Souto at 2018-05-09T20:24:19Z
signup: proper translation of terms of use error message

- - - - -
523b2e8a by Leandro Nunes at 2018-05-09T20:56:00Z
Merge branch 'user-terms-translation' into 'master-1.x'

signup: proper translation of terms of use error message

See merge request noosfero/noosfero!1472
- - - - -


3 changed files:

- app/models/user.rb
- config/locales/en-US.yml
- config/locales/pt-BR.yml


Changes:

=====================================
app/models/user.rb
=====================================
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -140,7 +140,7 @@ class User < ApplicationRecord
   before_save :generate_private_token_if_not_exist
   validates_format_of :email, :with => Noosfero::Constants::EMAIL_FORMAT, :if => (lambda {|user| !user.email.blank?})
 
-  validates_inclusion_of :terms_accepted, :in => [ '1' ], :if => lambda { |u| ! u.terms_of_use.blank? }, :message => N_('{fn} must be checked in order to signup.').fix_i18n
+  validates_inclusion_of :terms_accepted, :in => [ '1' ], :if => lambda { |u| ! u.terms_of_use.blank? }, :message => _('must be accepted in order to signup.').fix_i18n
 
   scope :has_login?, lambda { |login,email,environment_id|
     where('login = ? OR email = ?', login, email).


=====================================
config/locales/en-US.yml
=====================================
--- a/config/locales/en-US.yml
+++ b/config/locales/en-US.yml
@@ -216,6 +216,11 @@
       body: "There were problems with the following fields:"
 
   activerecord:
+    attributes:
+      user:
+        terms_accepted: "Terms of use"
+
+  activerecord:
     errors:
       messages:
         <<: *errors_messages


=====================================
config/locales/pt-BR.yml
=====================================
--- a/config/locales/pt-BR.yml
+++ b/config/locales/pt-BR.yml
@@ -229,6 +229,8 @@
     attributes:
       user:
         password: "senha"
+        terms_accepted: "Termos de uso"
+
     errors:
       messages:
         <<: *errors_messages



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/af25727dc8894dae3bf35839bf98d4d79173ac20...523b2e8a9da79c6797106e88f1fe3ce0e4f5c762

-- 
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/af25727dc8894dae3bf35839bf98d4d79173ac20...523b2e8a9da79c6797106e88f1fe3ce0e4f5c762
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180509/6141fb74/attachment-0001.html>


More information about the Noosfero-dev mailing list