Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Съобщенията за грешки при валидация вече и на български!
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sava Chankov  
View profile   Translate to Translated (View Original)
 More options Sep 18 2008, 12:07 pm
From: "Sava Chankov" <sava.chan...@gmail.com>
Date: Thu, 18 Sep 2008 19:07:20 +0300
Local: Thurs, Sep 18 2008 12:07 pm
Subject: Съобщенията за грешки при валидация вече и на български!

   1. gem install gettext
   2. добавяте в ApplicationController-а
     init_gettext "<името на вашето приложение>"
     GetText.locale = "bg"

...и съобщенията за грешка при валидация на ActiveRecord са на български!
Благодарение на Георги Стоименов, който ги преведе.

Ето и един пример с приложението, което Петьо написа на IT boxing-a:

class Chick < ActiveRecord::Base
  validates_presence_of :nick
end

в конзолата:

>> c=Chick.new

=> #<Chick id: nil, nick: nil, created_at: nil, updated_at: nil>
>> c.valid?
=> false
>> c.errors.full_messages

=> ["Полето „Nick" не може да е празно"]

За да получите ["Полето „прякор" не може да е празно"], създайте файл
lib/tasks/gettext.rake

desc "Compile .po to .mo files (l10n)."
task :makemo do
  require 'gettext/utils'
  GetText.create_mofiles(true, "./po", "./locale")
end

desc "Update pot/po files to match new version (i18n)."
task :updatepo do
  require 'gettext/utils'
  app = "<името на вашето приложение>"
  GetText.update_pofiles(app, Dir.glob("{app}/**/*.{rb,erb}"),app)
end

и после

rake updatepo
преведете .po файла (po/bg/<името на вашето приложение>.po)
rake makemo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »