나는 레일스에 처음 왔고, 나는 RTL 웹 사이트에서 일하고있다! comment.count 및 get_upvotes.size의 복수형을 수정하여 다른 언어 단어로 대체하려고합니다. Rails Internationalization (I18n)으로 할 수 있다고 들었지만 제 질문에 대한 명확한 답을 찾을 수 없었습니다.레일에서 덧글 및 좋아하는 것에 대한 복수화를 제거하거나 편집하는 방법
#post_show
%h1= @post.title
%p.username
before
= time_ago_in_words(@post.created_at)
.clearfix
.post_image_description
= image_tag @post.image.url(:medium)
.description= simple_format(@post.description)
.post_data
= link_to "Project link", @post.link, class: "btn btn-warning btn-block"
= link_to like_post_path(@post), method: :get, class: "data" do
%i.fa.fa-check
= pluralize(@post.get_upvotes.size, "Like")
%p.data
%i.fa.fa-comments.o
= pluralize(@post.comments.count, "Comment")
- if @post.user == current_user
= link_to "Edit", edit_post_path(@post), class: "data"
= link_to "Delete", post_path(@post), method: :delete, data: { confirm: "Sure?" },class: "data"
지금 필요한 건 그래서 복수화을 취소 할 경우 2 개의 댓글거나 복수형과 의견 변경되지 않습니다까지 더 쇼 :
다음은 show.html.erb 페이지 내 코드입니다. 대신 댓글과 동일하게 유지됩니다.
도움을 주시면 감사하겠습니다. 더 많은 정보가 필요하면 알려주세요! 감사합니다
pluralize 메서드를 사용하지 마십시오. '= "#{@post.comments.count} Comment"' – Swards
대체 할 대상은 무엇입니까? – hekmat