Environment | Build Status |
---|---|
Development | |
Production |
This is the repository for the Bike!Bike! website. It can be found in development at preview.bikebike.org and in production at bikebike.org
Feel free to clone or fork the repository any time to start working on new features or fixes. To get help create an issue or contact Godwin: goodgodwin
@
hotmail.com
any time.
We will make a commitment to extract any functionality that makes sense to do so, into separate gems in order to share functionality with others, with our other projects (such as bikecollectives.org), and to enable easier collaboration amongst ourselves.
It is recommended that you at least use also clone bikecollectives_core
into you workspace. To override the gem location execute:
bundle config local.bikecollectives_core PATH_TO/bikecollectives_core
Here is a list of the gems we have created so far, if you are a collaborator on this project you may need to become a collaborator on these gems as well. Don't hesitate to make a request, it won't be denied:
Bike Collectives Core is where models, migrations, and some common controllers and helpers live. This Gem is shared between Bike Collectives and Bike Collectives Workbench.
Lingua Franca provides an easy way to include translatable content and provides a user interface for translators to provide translations. See Translations for best practices on the Bike!Bike! website.
Bumbleberry provides cross-browser support with little effort and minimum file sizes. Basically it creates a different stylesheet for every known browser and only includes supported rules for each using information obtained from caniuse.com.
If you are a git wiz, feel free to adjust the steps below slightly, otherwise follow these steps until you are familiar enough to stray. What should remain constant is that we need to branch, code review, and merge with master.
git checkout -b myname_new_feature
bundle exec i18n
git status
git add [myfile]
git commit -am 'My commit message'
git checkout master && git pull
git checkout myname_new_feature
git rebase -i origin/development
git push origin myname_new_feature
Please note, we currently don't have this process set up, we're working to get here.
Translating our site into multiple languages is a key part of opening it up to the world. When coding, never include any English text as in a string or Haml. Instead, we shall always use the underscore helper method _
. The method takes a translation key and some optional parameters.
All translation is done in a collaborative, volunteer based system on the site itself, even the English text. If a user has sufficient permissions, the underscore method will produce highlighted text which can be edited directly by the user.
The method can be used as follows:
%h1=_'basename.my_title'
%p=_'basename.my_key', :paragraph
%button=_'basename.click_me'
Assuming none of the keys map to translations, this will be rendered into the following HTML:
<h1>
Lorem ipsum dolor sit amet
</h1>
<p>
Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Proin eget tortor risus. Donec sollicitudin molestie malesuada. Donec rutrum congue leo eget malesuada.
</p>
<button>
click me
</button>
By default, the key will be translated using the last key part ('click me' in this example), however if a context is provided, some appropriate lorem ipsum text. Available contexts are:
title
(alias: t
): title text, a few words in upper caseword
(alias: words
, w
): A word, if a second parameter is provided a numbr of words will be rendered (for example _'key',:w,3
)sentence
(alias: sentences
, s
): A sentence or multiple sentenceparagraph
(alias: p
): A paragraphIf actual translations are not provided by the time the code hits production, fatals will occur.
Translations can be provided directly by editing en.yml
but will also be directly using the workbench:
Translations, along with screenshots and HTML page captures are collected during testing so that the workbench will have up to date translations and context for each to make it easier for translators to provide relevant translations. To collect these translations yourself, execute rake i18n
.
Our focus will be on integration testing using Capybara. While testing the app records all translations that it finds, whether or not they exist, and which pages that they were found on.
Before commiting you shuold always run:
bundle exec rake cucumber:run
and:
bundle exec rake i18n
The former is going to be faster but does not perform checks for untranslated content, it is recommneded that you run this regularily while developing while running the i18n
check will ensure that you have not missed translations.
If you are creating any new content you will also want to add a new feature or scenario to ensure the new translations are picked up.