GetTextã§å®éã«æ¥æ¬èªåä½æ¥ããã£ã¦ã¿ãã
GetTextãå©ç¨ããå¦çããRadRailså ã§å¿«é©ã«å¦çã§ããããã«ãªã£ãã®ã§ãå®éã«ç¿»è¨³ä½æ¥ããã£ã¦ã¿ããã³ã³ããã¼ã©ã¼ãã¢ãã«ããã¥ã¼ãã¹ã¦ã®è¡¨ç¤ºã«é¢ããæè¨ã_()ã§å²ã£ã¦ã¿ãã
1)ã³ã³ããã¼ã©ã¼ï¼app/controllers/softwares_controller.rbã§ã®ã_()ã«ããå²ã¿ä½æ¥ä¾
def create @software = Software.new(params[:software]) if @software.save flash[:notice] = 'Software was successfully created.' redirect_to :action => 'list' else render :action => 'new' end end
ã»ãªãªã¼éãã«ãã¡ãã»ã¼ã¸ã®æè¨ã_()ã§å²ãã ã
flash[:notice] = _('Software was successfully created.')
3)ã§.poãã¡ã¤ã«ãæ´æ°ãããæããããªæãã§ç¿»è¨³ããã
#: app/controllers/softwares_controller.rb:52
msgid "Software was successfully created."
msgstr "ã½ããã¦ã§ã¢ãæ£å¸¸ã«ä½æããã¾ããã"
2)ãã¥ã¼ï¼app/views/softwares/ã§ã®ã_()ã«ããå²ã¿ä½æ¥ä¾
ãã¥ã¼ã®ä¸ã§ã¯åç´ã«åºæ¥ãªããã¨ãå¤ãã
å¼å±é#{}ãå«ãæååã®å ´åï¼list.rhtmlï¼
<%= link_to _('Destroy'),
{ :action => 'destroy', :id => software },
:confirm => "#{software.title} is deleted. Are you sure?",
:post => true %>
以ä¸ã®ããã«ããã©ã¼ãããæååã¨ãã¦å¦çããå¿ è¦ãããã
<%= link_to _('Destroy'),
{ :action => 'destroy', :id => software },
:confirm => _("%{software_title} is deleted. Are you sure?") % {:software_title => software.title},
:post => true %>
3)ã§.poãã¡ã¤ã«ãæ½åºãããæããããªæãã§ç¿»è¨³ããã
#: app/views/softwares/list.rhtml:39
msgid "%{software_title} is deleted. Are you sure?"
msgstr "ã¿ã¤ãã«ã%{software_title}ããåé¤ãã¾ãã ããããã§ãã?"
webãã©ã¦ã¶ã§ç¢ºèªããã¨ããã®ããã«è¡¨ç¤ºãããã
åãªãæååã®å ´åï¼_form.rhtmlï¼
ï¼pï¼ï¼label for="software_title"ï¼Titleï¼/labelï¼ï¼br/ï¼
ï¼%= text_field :software, :title, :size => 40 %ï¼ï¼/pï¼
.rhtmlã®ä¸ã§ã¯ã_()ã¯Rubyã¡ã½ãããªã®ã§ã<%= _('æåå') %>ã®ããã«å²ãå¿ è¦ãããã
ï¼pï¼ï¼label for="software_title"ï¼<%= _('Title') %>ï¼/labelï¼ï¼br/ï¼
ï¼%= text_field :software, :title, :size => 40 %ï¼ï¼/pï¼
ifã使ã£ã¦ãã...ãï¼list.rhtmlï¼
<%= link_to "#{@direction_mark if @order_field=='keyword_id'}Keyword",
:action => 'list_in_order',
:keyword_id => @keyword_id,
:order_field => 'keyword_id',
:order_direction => @order_next_direction %>
1è¡ã³ã¼ãã«ãã ããéããã¨ããã®ããã«å°ããã¨ã«ãªãã2è¡ã«åãã¦æ¸ãç´ããã
<%= @direction_mark if @order_field=='keyword_id' %> <%= link_to _('Keyword'), :action => 'list_in_order', :keyword_id => @keyword_id, :order_field => 'keyword_id', :order_direction => @order_next_direction %>
3).poãã¡ã¤ã«ã®æ´æ°
- RadRailsã®ãRakeã¿ã¹ã¯ãã¿ãã§updatepoãå®è¡ããã
- po/ja/softwarebook.poã«ãå ã»ã©_()ã§å²ã£ãæè¨ã追å ããã¦ãããä»ã¾ã§ç¿»è¨³ããæè¨ã¯ãã®ã¾ã¾æ®ã£ã¦ããã以ä¸ã®ããã«ç¿»è¨³ããã
#: app/controllers/softwares_controller.rb:52 msgid "Software was successfully created." msgstr "ã½ããã¦ã§ã¢ãæ£å¸¸ã«ä½æããã¾ããã" #: app/controllers/softwares_controller.rb:68 msgid "Software was successfully updated." msgstr "ã½ããã¦ã§ã¢ãæ£å¸¸ã«æ´æ°ããã¾ããã" #: app/models/keyword.rb:- msgid "keyword" msgstr "ãã¼ã¯ã¼ã" #: app/models/keyword.rb:- msgid "Keyword|Name" msgstr "ãã¼ã¯ã¼ã" #: app/models/software.rb:- msgid "software" msgstr "ã½ããã¦ã§ã¢" #: app/models/software.rb:- msgid "Software|Title" msgstr "ã¿ã¤ãã«" #: app/models/software.rb:- msgid "Software|Description" msgstr "æ¦è¦" #: app/models/software.rb:- msgid "Software|Url" msgstr "URL" #: app/models/software.rb:- msgid "Software|Created on" msgstr "ä½ææ¥æ" #: app/models/software.rb:- msgid "Software|Updated on" msgstr "ä¿®æ£æ¥æ" #: app/models/software.rb:- msgid "Software|Keyword" msgstr "ãã¼ã¯ã¼ã" #: app/models/software.rb:- msgid "Software|User" msgstr "" #: app/views/softwares/_form.rhtml:4 msgid "Title" msgstr "ã¿ã¤ãã«" #: app/views/softwares/_form.rhtml:8 msgid "Description" msgstr "æ¦è¦" #: app/views/softwares/_form.rhtml:11 msgid "Url" msgstr "URL" #: app/views/softwares/_form.rhtml:14 app/views/softwares/list.rhtml:14 msgid "Keyword" msgstr "ãã¼ã¯ã¼ã" #: app/views/softwares/edit.rhtml:1 msgid "Editing software" msgstr "ã½ããã¦ã§ã¢ã®ç·¨é" #: app/views/softwares/edit.rhtml:5 app/views/softwares/list.rhtml:36 #: app/views/softwares/show.rhtml:17 msgid "Edit" msgstr "ç·¨é" #: app/views/softwares/edit.rhtml:8 app/views/softwares/list.rhtml:35 msgid "Show" msgstr "詳細" #: app/views/softwares/edit.rhtml:9 app/views/softwares/list.rhtml:52 #: app/views/softwares/show.rhtml:18 msgid "Back" msgstr "æ»ã" #: app/views/softwares/list.rhtml:1 msgid "Listing softwares" msgstr "ã½ããã¦ã§ã¢ã®ä¸è¦§" #: app/views/softwares/list.rhtml:37 msgid "Destroy" msgstr "åé¤" #: app/views/softwares/list.rhtml:39 msgid "%{software_title} is deleted. Are you sure?" msgstr "ã¿ã¤ãã«ã%{software_title}ããåé¤ãã¾ãã ããããã§ãã?" #: app/views/softwares/list.rhtml:45 msgid "Previous page" msgstr "åãã¼ã¸" #: app/views/softwares/list.rhtml:46 msgid "Next page" msgstr "次ãã¼ã¸" #: app/views/softwares/list.rhtml:50 app/views/softwares/new.rhtml:1 msgid "New software" msgstr "æ°è¦ä½æ"
4).moãã¡ã¤ã«ã®æ´æ°
- RadRailsã®ãRakeã¿ã¹ã¯ãã¿ãã§makemoãå®è¡ããã