- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Rails 3.2.6,这是一个示例:
class Man < ActiveRecord::Base
has_many :eyes
accepts_nested_attributes_for :eyes
end
class Eye < ActiveRecord::Base
belongs_to :man
validates_inclusion_of :color, in: { %w[brown green blue] }
end
= form_for @man do |f|
- if @man.errors.any?
#error_explanation
%h2= t 'errors.messages.record_invalid', count: @man.errors.count
%ul
- @man.errors.full_messages.each do |msg|
%li= msg
= f.fields_for(:eyes) do |b|
.field
= b.label :color
= b.text_field :color
.actions
= f.submit :submit
it:
activerecord:
attributes:
customer:
eyes: Occhi
customer/eyes:
color: Colore
errors:
models:
man/eyes:
attributes:
color:
inclusion: non valido
errors.model.eyes.attributes.color.inclusion
而不是
errors.models.man/eyes.attributes.color.inclusion
errors.model.man.attributes.eyes.inclusion
,但我该如何区分呢?它应该类似于“Occhi Colore non valido”而不是“Occhi non valido”
最佳答案
试试这个:
it:
activerecord:
attributes:
# set the name used in nested attribute error messages
customer/eyes:
color: Occhi Colore
errors:
models:
# change the error message for eye color not included in the list
eye:
attributes:
color:
inclusion: non valido
messages:
# change the inclusion message globally
inclusion: non valido
helpers:
label:
# set the label used by form builder for labels
man[eyes_attributes]:
color: Occhi Colore
关于ruby-on-rails-3 - rails i18n accepts_nested_attributes_for how-to translate?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14176433/
我听说 Translate API 需要付费,但究竟是什么阻止了我们使用免费的 Google 翻译服务 here免费 ?否则,免费服务的限制是什么? 最佳答案 根据下面的链接,没有什么可以阻止您。 h
我正在修复我的 Karma 配置以运行 Angular2 - rc 1 版本的测试。我可以运行测试,但如果我在 html 中有一个翻译管道,它们就会失败。(我可以让它工作的配置是从 [这里][1] 得
我正在使用以下代码: GttService myService = new GttService("ex1cor.ex1Ap.1"); myService.setUserCredentials("ex
是否可以在 Silverstripe 3 中翻译数据对象? 我使用这个模块: http://www.silverstripe.org/translatable-module/ 在我的配置中是否定义了以
我有以下三个问题 我想使用 Google 的 API 来翻译文本。我知道谷歌对翻译和检测单独收费。谷歌翻译也支持翻译两种翻译方式 i) 通过指定源和目标,如 https://www.googleapi
我一直在使用 Microsoft Translator 的 HTTP API 来翻译我网站上的文本。 作为the documentation describes , 有一个选项可以指定翻译的类别。找不
当您在 localhost 上开发应用程序时,是否有机会在不获取 key 的情况下使用 Use Google Translation API? 我希望这样的事情能够奏效' https://www.go
我正在尝试翻译实体的某些字段,但在尝试创建对象时出现以下错误... id; } /** * Set name * * @param string $nam
当用户访问我们的网站时,我们使用 Google Translate API 将我们的内容翻译成用户的语言。 (当然,我们遵循署名和链接要求,以便用户知道内容是 Google 的翻译。) 为了优化,我们
我非常频繁地使用谷歌翻译 API V2,在大约 2000 个请求之后,我开始在返回的 JSON 中得到这个: Array ( [error] => Array (
我刚开始使用 Google 翻译 API,在测试过程中我们注意到,对于某些翻译(我尚未找到模式),我们会在响应中收到\u200b 字符。这会导致很多问题,最重要的是,它似乎没有任何目的或没有任何意义。
从laravel 5.8升级到laravel 6.0后,发现这个错误。 Method Illuminate\Translation\Translator::getFromJson does not e
这是一个基本的移动滑入/滑出菜单。 我发现很难调试,但基本上我的问题是,当我按下菜单按钮时,菜单会顺利打开,再次按下它会顺利关闭。然而,当我再次按下它(第三次)时,它不顺利打开,它只是出现。但是它仍然
我的 Android Studio 的翻译编辑器无法正常工作。如果我打开翻译编辑器确实列出了字符串的正确键,但是找不到默认值和翻译。所有键都有一个默认值,其中大多数也有一个翻译。 我重新启动了 And
我正在尝试从 python 控制台而不是通过 bazel -build 运行 Tensorflow 的 translate.py,但我在这两行出现错误: from tensorflow.models.
本文整理了Java中org.apache.tika.language.translate.YandexTranslator.translate()方法的一些代码示例,展示了YandexTranslat
我需要来自 Google Transle API 的同义词信息。有没有可能得到它? 最佳答案 抱歉不行。看到这个 post .看起来他们opened a PIT添加功能。你应该给它加星号来增加重量!
我在我的一个项目中使用 Google Cloud Translation API。我想指定翻译的性别。我无法在 Google Cloud Translation 中找到相关信息。我也在互联网上搜索了很
我已经在我的 Angular-Cli 应用程序中实现了 ngx-translate 并且在我执行以下操作时工作正常: {{ 'some.value' | translate }} 但是我该如何翻译 H
我决定在我的项目中使用 Google Cloud Translation API。在我尝试运行他们的脚本之前,一切似乎都很好。它总是说我需要“使用 require([])”。 在我在 require
我是一名优秀的程序员,十分优秀!