EDIT:
spree-core: The product form does not handle displaying product.price and product.cost_price in relation to I18n / localization. To fix this for you, you need to change the kernel. I'm going to post this on the Spree Core team, but in the interim I tested this fix and it should work.
In /gems/spree_core-1.0.0/app/views/spree/admin/products/_form.html.erb you will need to change the following lines:
<%= f.text_field :price, :value => number_with_precision(@product.price, :precision => 2) %>
:
<%= f.text_field :price, :value => number_with_precision(@product.price, :precision => I18n.t('number.currency.format.precision'), :separator => I18n.t('number.currency.format.separator'), :delimiter => I18n.t('number.currency.format.delimiter')) %>
and this:
<%= f.text_field :cost_price, :value => number_with_precision(@product.cost_price, :precision => 2) %>
:
<%= f.text_field :cost_price, :value => number_with_precision(@product.cost_price, :precision => I18n.t('number.currency.format.precision'), :separator => I18n.t('number.currency.format.separator'), :delimiter => I18n.t('number.currency.format.delimiter')) %>
Essentially, we are creating potential I18n values ββfor it.
ORIGINAL:
I accurately reproduced your file and tried several tests to recreate this (create a new product, a new version of the product, change the price of the product, cost, etc.). To recreate this, you need to create de_numbers.yml and flip your localization as "de" in the Spree initializer using "config.default_locale = 'de"
Here are some suggested fixes:
- make sure you run package installation
- in your gemfile, make sure you are using the latest version of i18n (
gem 'spree_i18n' ,: git => 'git: //github.com/spree/spree_i18n.git')
- fix blank space in 2 spaces instead of tabs (this is potentially a white space issue where it cannot read your i18n values )
- Go to the rails console and log out (i.e.
I18n.t ('number.currency.format.unit')
- Try to get this to work first "en" and then "de".
- First add your values ββto "de.yml" or "en.yml" and see if they work before inserting them into the file "de_currency.yml".