How LocaleBadger Works

Installing the LocaleBadger GitHub App

  • To install LocaleBadger, follow the link to the LocaleBadger GitHub app page
  • application page
    LocaleBadger page.
  • Select the GitHub account where you want to install LocaleBadger.
  • install
    Installing LocaleBadger in an account.
  • Grant access to the repositories you want LocaleBadger to monitor for translations.
  • repository access
    Granting access to individial repositories.

Configuration

Languages

  • In the root level of your application, create a file named .translate.yml.
  • configuration file
    Example of a configuration file.
  • The root field sets the directory for the language files. For example, locales is a standard location for React projects.
  • The src field defines the locale of the original texts. For instance, en for English. The folder locales/en will store the source language files.
  • The dst field defines the locales you want to translate to, such ases for Spanish or fr for French. The folder locales/es will store the translated files. You can set multiple locales.
locale files
English locale files.

Translation API Key

  • LocaleBadger relies on third-party service providers like Google Cloud Translate for translations. To have control over expenditures, users need to provide an API key. Google allows users to create dedicated keys and set budget limits. To create a Google Cloud Translate API key, go to API Key Setup
  • To limit usage quota, visit Usage Quota Limit
  • Open LocaleBadger's management page and log in with your GitHub account.
  • Click Edit Installation to set the Google Cloud Translate API key.

How LocaleBadger Works

  • Pull Request Creation: When a pull request is created, LocaleBadger scans the affected files and detects changes in language files.
  • Pull Request Update: When a pull request is updated by merging branches or pushing additional commits, LocaleBadger scans the affected files for changes in language files.
  • Commands: Users can enter commands in pull request comments to interact with LocaleBadger.

How LocaleBadger Keeps You Informed With Reactions

ReactionWhat LocaleBadger is doing
👀started working
👍🏻finished successfully
👎🏻finished because of an error
😕skipped translations

What LocaleBadger Does

  • Maintain Cleanliness: If an obsolete source language file is removed, LocaleBadger automatically removes its corresponding translations.
  • Fill the Gaps: When a new translation key is added, LocaleBadger adds the corresponding translations to the matching language files.
  • Surgical Updates: If the content of an existing key is modified, LocaleBadger updates only the corresponding translations in the matching language files.
  • Keep in Sync: If the configuration file is modified, such as adding a new language, LocaleBadger creates new translations for missing files.
  • Give You the Final Say: LocaleBadger creates a dedicated pull request based on your branch, allowing you to review its work and merge it if acceptable.

Commands

Mention @localebadger [COMMAND] in a pull request comment, and LocaleBadger will take action.

  • sync: Useful for first-time translations when LocaleBadger is installed on an existing project to jumpstart the translation process.
  • skip: when in a pull-request title or body, it will skip translations.
  • help: Provides helpful information by commenting on the pull request.
arsawatt

Arsawatt makes remote work more fulfilling, productive, and balanced by creating simple and effective tools.