Activity 1

Add the locale to the products column, and adjust the index view to select only the products that match the locale. Adjust the products view so that you can view, enter, and alter this new column. Enter a few products in each locale, and test the resulting application.

Hint: You can use where(locale: I18n.locale) to select products matching the locale.


Activity 2

Determine the current exchange rate between U.S. dollars and euros, and localize the currency display to display euros when ES_es is selected.

Hint: Define your own helper method which will do the conversion and call number_to_currency on the result.


Activity 3

Translate the Order::PAYMENT_TYPES shown in the dropdown. You will need to keep the option value (which is sent to the server) the same. Only change what is displayed.

Hint: See options_for_select for information on alternate ways in which you can specify options.


Other Discussions