Skip to content

Translate your Factorio mod easily with the power of Crowdin

License

Notifications You must be signed in to change notification settings

dima74/factorio-mods-localization

Repository files navigation

Translate your Factorio mod easily with the power of Crowdin

Crowdin Website factorio-mods-localization.fly.dev GitHub Actions Status GitHub license GitHub issues

Description

We provide service for simplifying Factorio mods translation. You only need to install our GitHub app. After this, the following actions will be performed automatically:

  • All existing English strings of your mod will be uploaded to Crowdin
  • All existing translations will be uploaded too
  • Every week our FactorioBot will fetch translation updates from Crowdin and commit them to your repository

Motivation

There are a lot of Factorio mods hosted on GitHub. Most of them are translated using pull requests. It is not very convenient (because it is unclear which strings are untranslated yet and translators have to know how to use git). So, I created a helper tool for configuring the translation process on Crowdin, a powerful localization platform.

Installation

  1. Go to our GitHub app page
  2. Click the install button
  3. By default, the app will be installed for all repositories, and the app will automatically find repositories that have locale folder. Alternatively, you can manually select repositories for which app will be installed
  4. Click the install button

You are done! Now share the link to this Crowdin project with translators.

Please note that only Crowdin should be used for translation. GitHub pull requests must not be used for translation, otherwise translations will be lost after the next synchronization from Crowdin! Consider adding link to Crowdin to your repository Readme (example).

How to translate using Crowdin

We have a single Crowdin project. It consists of several folders, each folder corresponds to one mod. So, here are instructions on how to translate specific mod:

  1. Go to Crowdin project page
  2. Select language
  3. Find the folder with your mod
  4. Open the menu (click on three points) right of the folder name
  5. Click "Open in Editor": menu

Then Crowdin translation interface will be opened where you can translate strings.

Notes

  • To correctly upload your existing translations to Crowdin, files in any localization folder (such as /locale/de) must have the same names as files in /locale/en folder.
  • If a repository has branch protection rules, our helper will create a pull request (instead of pushing to the main branch directly).
  • Please ask any questions or report bugs by creating a new issue.

Configuration

There are options which can be added to factorio-mods-localization.json config file located in the root of your repository.

List of currently supported options (see corresponding section for description of each option):

{
  "mods": ["mod1", "mod2"],
  "weekly_update_from_crowdin": false,
  "branch": "dev"
}

Configuration: Multimods

It is possible to have multiple Factorio mods in a single GitHub repository. Add "mods" option with a list of submods to the config:

├── factorio-mods-localization.json  // {"mods": ["Mod1", "Mod2"]}
├── Mod1
│   ├── locale/en
├── Mod2
│   ├── locale/en

Configuration: Disable weekly updates from Crowdin

It is possible to disable automatic weekly updates from Crowdin and perform them manually when needed. To do so, add "weekly_update_from_crowdin": false option to the config.

Now you can perform an update manually using the following URL:

https://factorio-mods-localization.fly.dev/api/triggerUpdate?repo=OWNER/REPO

Configuration: Specify branch

It is possible to use some other branch instead of the default branch. To do so, add "branch" option to the config.

Note that the factorio-mods-localization.json config file should still be in the default branch.

Detailed description of how it works

  1. Mod author has a mod repository on GitHub
  2. Mod author installs GitHub app (for mod repository)
  3. Our service creates a subdirectory in our Crowdin project and uploads original English strings and existing translations into it
  4. Every week our service takes translated strings from Crowdin and makes a commit to the GitHub repository (if there are any changes)
  5. Every time original (locale/en) strings are changed, our service changes appropriate strings on Crowdin