loading...

Spree Commerce
Translation Support

Description

Spree Commerce is an open-source ecommerce platform built on Rails. It provides solutions for highly customizable digital marketplaces.

For the Spree 4.6 release, I led the implementation of translation support for Spree resources, which allows admins of an online store to add translations for products, categories, and numerous other resources in the store. The translations are tied to the locale selected in the browser, such that when the user is browsing with ‘French’ selected as their language, all resource data are displayed in French.

Translation support was implemented using the mobility gem.

Changes included as part of translation support:
  • Creation of tables to hold translation data for each translatable resource
  • Updates to methods that access resources with translatable data such that resource data is automatically pulled in the currently selected language
  • Updates to the search functionality: allowing users to search in their selected language
  • API endpoints updated to allow for retrieving and updating translations on translatable resources
  • Addition of a migration template to make it easier to set up translations for custom resources
  • Implementation of admin-side pages for managing translations
Relevant PRs include:
Details
Categories: Backend Development