Table: RailsNotes
User: dreamable
Created at: 2021-05-02 23:57:46 UTC
Updated at: 2021-05-02 23:57:46 UTC
Reference:(Table ID 3, Record ID 46)

标题 :
Rails i18n strings auto-lowercased?
笔记 :

source

There should be no modifications to the content you specify as part of the internationalization process. It sounds like something is calling humanize on the string before it is output. Some of the standard Rails form helper methods do this I believe. If you just output the translation using t('email') you should see 'E-Mail' correctly.

Update: From your comments it seems like it is a label that is causing the problem. If you explicitly specify the text for the label rather than relying on the default behaviour you will get the translation exactly as you specify. So,

<%= f.label(:email, t('email')) %>

should generate the correct label from the translations.

Tag: