小编Gab*_*nml的帖子

在Rails中利用单词的最佳实践是什么?

我正在研究R语言中的语言,我想知道什么是大写单词时的最佳实践.

en.yml:

hello: "hello"
Run Code Online (Sandbox Code Playgroud)

application.html.erb:

<%= link_to t(:hello).capitalize, hello_path %> (with capitalization)
<%= link_to t(:hello), hello_path %> (without capitalization)
Run Code Online (Sandbox Code Playgroud)

要么

en.yml:

Hello: "Hello"
hello: "hello"
Run Code Online (Sandbox Code Playgroud)

application.html.erb:

<%= link_to t(:Hello), hello_path %> (with capitalization)
<%= link_to t(:hello), hello_path %> (without capitalization)
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails internationalization

11
推荐指数
1
解决办法
5527
查看次数

标签 统计

internationalization ×1

ruby ×1

ruby-on-rails ×1