Saimon Moore 05d757e7c4 Ensure we have min i18n fallbacks
This setting defines which locales will be exported to the frontend.
In general, ofn currently functions under a single locale
(which is also the default locale) but all translations are made from
the `en` locale.

The current process of ensuring translations are translated and make
their way into code is manual and prone to issues so occasionally
translations for keys in the default locale of a particular instance
are not deployed and the UI displays `missing translation` messages.

In these cases, it is far friendlier for the user to see fallbacks to
`en` rather than these errors so this commit ensure that at the very
least apart from the current default locale, `en` is also made available
and as such will be exported to the frontend so that it's translations
are available as a fallback in JS land.

I18n fallback config was already enabled in both frontend and backend.
Until now, available locales may not have been set (determined by the
`AVAILABLE_LOCALES` env var) and the translations for `en` not therefore
be present in the frontend for fallback to actually work.

This commit will ensure that a fallback to `en` is always possible in the
case of missing translations.
2017-11-10 12:30:24 +11:00
2015-12-24 11:44:12 +11:00
2017-11-10 12:30:24 +11:00
2014-03-19 15:25:36 +11:00
2012-03-27 10:10:26 +11:00
2017-10-06 14:24:28 +11:00
2017-11-10 08:47:12 +11:00
2016-05-25 08:10:20 +10:00
2017-07-06 18:15:24 +10:00
2015-01-09 15:30:49 +11:00
2017-09-23 14:58:34 +10:00
2017-10-07 11:50:59 +01:00
2015-11-05 11:09:22 +11:00
2016-02-09 06:11:13 +00:00
2017-05-03 11:50:07 +01:00
2017-11-10 08:47:12 +11:00
2017-11-10 08:47:12 +11:00
2012-12-18 15:56:54 +11:00
2012-03-27 11:22:20 +11:00

Build Status Code Climate

Open Food Network

The Open Food Network is an online marketplace for local food. It enables a network of independent online food stores that connect farmers and food hubs (including coops, online farmers' markets, independent food businesses etc); with individuals and local businesses. It gives farmers and food hubs an easier and fairer way to distribute their food.

Supported by the Open Food Foundation, we are proudly open source and not-for-profit - we're trying to seriously disrupt the concentration of power in global agri-food systems, and we need as many smart people working together on this as possible.

We're part of global movement - get involved!

Getting started

Below are instructions for setting up a development environment for Open Food Network. More information is in the developer wiki.

If you're interested in provisioning a server, see the project's Ansible playbooks.

Dependencies

  • Rails 3.2.x
  • Ruby 2.1.5
  • PostgreSQL database
  • PhantomJS (for testing)
  • See Gemfile for a list of gems required

Get it

The source code is managed with Git (a version control system) and hosted at GitHub.

You can view the code at:

https://github.com/openfoodfoundation/openfoodnetwork

You can download the source with the command:

git clone https://github.com/openfoodfoundation/openfoodnetwork.git

Get it running

For those new to Rails, the following tutorial will help get you up to speed with configuring a Rails environment: http://guides.rubyonrails.org/getting_started.html .

First, check your dependencies: Ensure that you have Ruby 2.1.5 installed:

ruby --version

Install the project's gem dependencies:

cd openfoodnetwork
bundle install

Configure the site:

cp config/application.yml.example config/application.yml
edit config/application.yml

Create a PostgreSQL user:

  • Login as your system postrgresql priviledged user: sudo -i -u postgres (this may vary on your OS). Now your prompt looks like: [postgres@your_host ~]$
  • Create the ofn database superuser and give it the password f00d:
createuser -s -P ofn

Create the development and test databases, using the settings specified in config/database.yml, and populate them with a schema and seed data:

bundle exec rake db:setup

Load some default data for your environment:

bundle exec rake openfoodnetwork:dev:load_sample_data

At long last, your dreams of spinning up a development server can be realised:

bundle exec rails server

To login as Spree default user, use:

email: spree@example.com
password: spree123

Testing

Tests, both unit and integration, are based on RSpec. To run the test suite, first prepare the test database:

bundle exec rake db:test:prepare

Then the tests can be run with:

bundle exec rspec spec

The site is configured to use Zeus to reduce the pre-test startup time while Rails loads. See the Zeus github page for usage instructions.

Once npm dependencies are installed, AngularJS tests can be run with:

./script/karma run

If you want karma to automatically rerun the tests on file modification, use:

./script/karma start

Multilingual

Do not forget to run rake tmp:cache:clear after locales are updated to reload I18n js translations.

Credits

Licence

Copyright (c) 2012 - 2015 Open Food Foundation, released under the AGPL licence.

Description
Connect suppliers, distributors and consumers to trade local produce.
Readme 169 MiB
Languages
Ruby 74.7%
Haml 9.4%
CoffeeScript 7.3%
SCSS 4.5%
JavaScript 3.6%
Other 0.4%