-
-
Notifications
You must be signed in to change notification settings - Fork 724
Locale and sample data
If you just need to have some sample data, run bundle exec rake ofn:sample_data
and it will do the trick, otherwise continue reading, please.
Following the defaults in this guide will result in an instance configured for Australia. While this is sufficient for most development work, it is often useful to have a development environment set up for another locale. Managers of other OFN instances may be able to provide dumps of sample data that can be used. These can be set up as follows:
- Obtain a database dump e.g.
foo.sql.gz
. - From a terminal, in the OFN repository root directory, run
script/restore.sh foo.sql.gz
- Run
rails runner script/prepare_imported_db.rb
to disable some production payment settings. - Run
rake db:migrate
to migrate any database changes since the dump. - If you don't have admin credentials for the data you can set up your own super-admin user by running
rake spree_auth:admin:create
and following the prompts.
Finally, if the data are from a non-Australia locale, change config/application.yml
appropriately, e.g.:
TIMEZONE: London
# Default country for dropdowns etc. See for codes: http://en.wikipedia.org/wiki/ISO_3166-1
DEFAULT_COUNTRY_CODE: GB
# Locale for translation.
LOCALE: en-GB
# Spree zone.
CHECKOUT_ZONE: UK
# Find currency codes at http://en.wikipedia.org/wiki/ISO_4217.
CURRENCY: GBP
In development, since July 2021 it is also necessary to adapt .env.development.local
. Note that this one is not a yaml file. Bellow is a sample of a development environment where default language is set to French, and where language menu will display English, Esperanto and French:
LOCALE="fr"
AVAILABLE_LOCALES="en,eo,fr"
The Rails server must be rebooted to take this configuration into consideration.
Development environment setup
- Pipeline development process
- Bug severity
- Feature template (epic)
- Internationalisation (i18n)
- Dependency updates
Development
- Developer Guidelines
- The process of review, test, merge and deploy
- Making a great commit
- Making a great pull request
- Code Conventions
- Database migrations
- Testing and Rspec Tips
- Automated Testing Gotchas
- Rubocop
- Angular and OFN
- Feature toggles
- Stimulus and Turbo
Testing
- Testing process
- OFN Testing Documentation (Handbooks)
- Continuous Integration
- Parallelized test suite with knapsack
- Karma
Releasing
Specific features
Data and APIs
Instance-specific configuration
External services
Design