Skip to content

Latest commit

 

History

History
135 lines (95 loc) · 4.16 KB

CONTRIBUTING.md

File metadata and controls

135 lines (95 loc) · 4.16 KB

Contributing to Juicebox

If you're interested in contributing ideas or code to Juicebox, you're in the right place!

Development

Check out the README for instructions on running the app in development.

Finding something to work on

Start with issues labelled good first issue.

Getting your pull request reviewed, approved, and merged

Create a pull request (PR) that targets the main branch. A live Fleek preview will be automatically deployed for each PR.

When your PR has met the #approval guidelines and is ready for review, @mention a codeowner and ask for a review.

Git workflow

We opt for a rebase policy where the repository history is kept flat and clean. When a feature branch's development is complete, rebase/squash all the work down to the minimum number of meaningful commits.

While the work is still in progress and a feature branch needs to be brought up to date with the upstream target branch, use rebase – as opposed to pull or merge – to avoid polluting the commit history with spurious merges. Learn more about the differences between merge and rebase Git workflows.

Approval guidelines

Before your PR is merged, it must meet the following criteria:

  1. The PR follows the Git workflow and contains no merge commits.
  2. All CI checks pass.
  3. The PR is approved by at least one codeowner.
  4. Significant UI/UX changes are discussed by other design/dev contributors.

Juicebox app release

All changes to the main branch will be automatically deployed via Fleek.

Translations

Juicebox uses lingui.js for internationlization (i18n). Languages we support are defined in .linguirc.json. en is our source language.

Developers should mark strings for translation using one of the lingui.js macros. Strings marked for translation will be extracted at build-time and added to messages.po files within the ./locale directory.

Contributing translations

The following steps describe how to contribute translations for a given language. You will contribute translations directly to this repository. This means you need a GitHub account.

  1. Create a fork of this repository.

  2. Clone your fork to your local machine.

  3. Open the messages.po file for the locale you want to add translations for. For example, to add Chinese translations, open the ./locale/zh/messages.po file.

  4. Locate the string you want translate in the msgid field.

    For strings where a msgid has been manually set, find the msgstr for the given msgid in the ./locales/en/messages.po file (the source locale).

  5. Add the translation in the msgstr field.

    msgid "Community funding for people and projects"
    - msgstr ""
    + msgstr "为个人和项目提供社区资助"
  6. Commit the changes and create a pull request on GitHub.

If you need help at any stage, reach out in the Discord.

Adding a language

  1. Add the locale code to ./linguirc.json.

    - "locales": ["en", "zh"]
    + "locales": ["en", "zh", "af"]
  2. Add the locale code to SUPPORTED_LOCALES in ./src/constants/locale.ts

    - export const SUPPORTED_LOCALES = ['en', 'zh']
    + export const SUPPORTED_LOCALES = ['en', 'zh', 'af']
  3. Import the locale plurals in ./src/i18n.tsx.

    - import { en, zh } from 'make-plural/plurals'
    + import { en, zh, af } from 'make-plural/plurals'
  4. Load the locale plurals in ./src/i18n.tsx

    i18n.loadLocaleData({
      en: { plurals: en },
      zh: { plurals: zh },
    + af: { plurals: af },
    })
  5. Extract the strings marked for translation. This creates a directory for the locale within the ./locale/ directory:

    yarn i18n:extract