Skip to content

Latest commit

 

History

History
159 lines (113 loc) · 4.87 KB

CONTRIBUTING.md

File metadata and controls

159 lines (113 loc) · 4.87 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.

Rebase procedure

You can rebase your feature branch with the following procedure, where feature-branch is the name of your branch. Further explanation of rebase and its options can be found here.

  1. git checkout feature-branch
  2. git fetch origin main
  3. git rebase origin/main
  4. git push --force-with-lease

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.

Supported browsers

Juicebox supports the following web browsers:

  • Google Chrome
  • Mozilla Firefox
  • Chromium-based browsers (e.g. Brave Browser)

Translations

Juicebox uses Crowdin for managing translations. A GitHub workflow uploads new strings for translation to the Crowdin project whenever code using the lingui translation macros is merged into main.

Every day, translations are synced back down from Crowdin to a pull request to main. We then merge these PR's into main manually.

Marking strings for translation

Any strings that are added or modified in the source code should be marked for translation. Use the t macro or the Trans component from the @lingui/macro library. Learn more.

const myString = t`Example text`
<Trans>Example text</Trans>

You must extract strings in PRs. If your PR adds or modifies translated strings, run the following command to generate new .po files:

yarn i18n:extract

Contributing translations

For details of how to contribute as a translator, see our How to become a Juicebox translator Notion page.

Adding a language (for devs)

  1. Add the locale code, english name, and short and long alias's to constants/languages/language-options.ts.

    export const Languages: Language = {
       en: { code: 'en', name: 'english', short: 'EN', long: 'English' },
       zh: { code: 'zh', name: 'chinese', short: '中文', long: '中文' },
       ru: { code: 'ru', name: 'russian', short: 'RU', long: 'Pусский' },
    +  es: { code: 'es', name: 'spanish', short: 'ES', long: 'Español' },
    }
  2. Add the locale code to ./linguirc.json.

    - "locales": ["en", "zh"]
    + "locales": ["en", "zh", "af"]
  3. 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']
  4. Import the locale plurals in ./src/providers/LanguageProvider.tsx.

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

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

    yarn i18n:extract && yarn i18n:compile