Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Application controller
- before_filter :set_locale
- [...]
- def set_locale
- if params[:locale]
- session[:lang] = params[:locale]
- end
- I18n.locale = session[:lang] || 'pl'
- @app_lang = session[:lang] || 'pl'
- end
- ## Model (kilka walidacji)
- validates_format_of :login, :with => RE_LOGIN_OK, :message => I18n.t('user.error.login.format'), :if => :not_using_openid?
- validates_format_of :name, :with => RE_NAME_OK, :message => I18n.t('user.error.name.format'), :allow_nil => true
- ## Plik lang pl
- user:
- error:
- mail: "^Nie poprawny format adresu mail"
- login:
- presence: "^Musisz wprowadzić login"
- length: "^Login jest zbyt krótki"
- uniquness: "^Wprowadzony login jest już zajęty"
- format: "^Wprowadzony login jest nieprawidłowy"
- name:
- presence: "^Musisz podać twoje imię"
- length: "^Twoje imię jest zbyt krótkie"
- format: "^Nie poprawny format imienia"
- mail:
- presence: "^Musisz podać twój adres email"
- uniquness: "^Wprowadzony adres istnieje już w naszej bazie"
- format: "^Błędny format wprowadzonego adresu email"
- length: "^Wprowadzony adres email jest za krótki!"
- openid:
- uniquenss: "^Podana tożsamość już istnieje w naszej bazie"
- password:
- noconfirm: "^Hasło wymaga potwierdzenia"
- confirmation: "^Hasło zostało błędnie potwierdzone"
- length: "^Wprowadzone hasło jest za krótkie"
- presence: "^Musisz zaproponować hasło"
- ## Plik lang en
- user:
- error:
- mail: "^Incorrect email address format"
- login:
- presence: "^You must enter login"
- length: "^Login too short"
- uniquness: "^The login you enetered is busy"
- format: "^The login you entered is incorrect"
- name:
- presence: "^You must give your name"
- length: "^Your name is too short"
- format: "^Incorrect name format"
- mail:
- presence: "^You must give yout email addressl"
- uniquness: "^The email address you entered is already in our base"
- format: "^Incorrect format of email entered"
- length: "^The email address you typed in is too short!"
- openid:
- uniquenss: "^This identity already exists in our base"
- password:
- noconfirm: "^Passoword requires conformation"
- confirmation: "^Passwors was incorrectly confirmed"
- presence: "^You must give your password"
- length: "^The password you typed in is too short!"
- ## Przy rejestracji otrzymuje (ustawiony PL bo wszystkie inne elementy są załadowane z pl oprócz validacji)
- Błędy dotyczą następujących pól:
- * Passoword requires conformation
- * You must enter login
- * Login too short
- * The login you entered is incorrect
- * You must give your password
- * The password you typed in is too short!
- * You must give yout email addressl
- * The email address you typed in is too short!
- * Incorrect format of email entered
Add Comment
Please, Sign In to add comment