0
我現在在我的seeds.rb以下如何在seeds.rb中爲create_or_update進行翻譯?
os = OrderStatus.find(1)
os.translations.create(:status => "In aanmaak", :locale => "nl")
os.translations.create(:status => "Creating", :locale => "en")
然而,這造成雙打。所以我試圖做一個create_or_update而不是create,但似乎沒有被支持。我使用globalize3
這可行,但問題是,如果我將狀態更改爲例如: os.translations.where(:status =>「Creation」,:locale =>「en」)。first_or_create 我將有2該訂單狀態的英文翻譯 – rept
你會一直這兩個領域的變化還是會保持不變? –
對於每個OrderStatus,在1種語言中只能存在1個翻譯,因此1對於nl只有1個...因此它應該搜索區域設置並插入或更新文本。所以一個會保持不變(區域設置)。 – rept