简体   繁体   English

变形-德国规则(铁路或其他规则)

[英]Inflection - German rules (Rails or others)

What are the best Rails inflection rules for the German language out there? 在那里,德语的最佳Rails变形规则是什么? Examples from other languages to be ported would be great, too. 来自其他语言的示例也将很好。

In my experience looking for a complete set of German inflection rules is hopeless. 以我的经验,寻找一套完整的德国拐点规则是没有希望的。 Even the default ones (English) are incomplete. 即使默认值(英文)也不完整。

Here's what I do in my Rails applications. 这是我在Rails应用程序中所做的事情。

  • Only use pluralize and Co. for code identifiers. 仅使用复数和Co.作为代码标识符。
  • For model names (and all "user facing" strings) use the I18n API even if there's only one language. 对于模型名称(以及所有“面向用户”的字符串),即使只有一种语言也要使用I18n API。

Configuring the I18n stuff is slightly more work to set up, on the other hand your code is no longer cluttered with end-user messages. 配置I18n东西要花更多的工夫,另一方面,您的代码也不再受最终用户消息的干扰。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM