File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1502,6 +1502,24 @@ language, translations will be looked up in the fallback languages:
1502
1502
I18n.locale = :de
1503
1503
product.description # "Marvelous!"
1504
1504
1505
+ Mongoid also defines a ``:fallbacks`` option on fields, which can be used to
1506
+ disable fallback functionality on a specific field:
1507
+
1508
+ .. code:: ruby
1509
+
1510
+ class Product
1511
+ include Mongoid::Document
1512
+ field :description, type: String, localize: true, fallbacks: false
1513
+ end
1514
+
1515
+ product = Product.new
1516
+ I18n.locale = :en
1517
+ product.description = "Marvelous!"
1518
+ I18n.locale = :de
1519
+ product.description # nil
1520
+
1521
+ Note that this option defaults to ``true``.
1522
+
1505
1523
.. note::
1506
1524
1507
1525
In i18n 1.1, the behavior of fallbacks `changed <https://github.com/ruby-i18n/i18n/pull/415>`_
You can’t perform that action at this time.
0 commit comments