Skip to content

factoriolab/factoriolab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

791 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FactorioLab

build tests

This is the repository for the FactorioLab project, a tool for calculating resource and factory requirements for factory games.

Supported games
Factorio Calculator Steam
Dyson Sphere Program Calculator Steam
Satisfactory Calculator Steam
Captain of Industry Calculator Steam
Techtonica Calculator Steam
Final Factory Calculator Steam
Factor Y Calculator Steam
Foundry Calculator Steam
Outworld Station Calculator Steam

This project is intended to build on the features of the Kirk McDonald Factorio Calculator (GitHub). It is built from the ground up using Angular, Redux, and TypeScript.

To submit suggestions or issues, please check out the issues page.

To discuss the calculator, join the Discord.

If you love FactorioLab, consider supporting it by buying me a ☕!

Running online

The calculator can be found at https://factoriolab.github.io.
The staging environment, for testing pull requests, can be found at https://factoriolab.github.io/staging.

Running locally

To run this project locally:

  1. Install NodeJS
  2. Install dependencies, using npm ci
  3. Build and serve the project, using npm start
  4. Open a browser at http://localhost:4200

The app will reload automatically if source code is changed.

Running tests

To run the automated unit tests:

  1. Install NodeJs, Angular CLI, and the dependencies as described above
  2. Build and run the tests, using npm test

Contributing language data

Language data is stored in the i18n folder. Translations are managed via an automated script. The English file, en.json, is the main translation data file; any keys added to that file will be added to all other files, and any keys missing from that file will be removed from other files.

Setup

In order to fully contribute, you must first fork FactorioLab in GitHub and clone your fork. If you are not experienced with GitHub and git, you are also welcome to copy and modify the raw JSON files, and share them via the Discord.

Updating files

The main script that maintains translation data is npm run sync-i18n. This command:

  1. Sorts all of the translation keys in all files, including the English file
  2. Removes any translation keys in non-English data files that are not found in the English file
  3. Adds English translation values to non-English data files where they are missing

As such, one of the best ways to contribute is to browse the non-English files and replace any English strings with a proper translation, or improve existing translations.

Adding a new language

In order to add support for a new language, there are a few additional steps.

  1. Add a new file in the i18n folder, using the localization key for the language. This is usually a two-letter locale code but may include a country code as well where relevant (e.g. pt-BR is Brazilian Portuguese).
  2. Enter {} in the file for an empty JSON object.
  3. Run npm run sync-i18n. This should fill in the file with English translations.
  4. Replace the English strings with translations.
  5. Add the code (which should match the file name) to the Language string union type in language.ts
  6. Add the langage as an Option in the languageOptions array in the same file.
  7. Open a Pull Request with your changes.

Thanks for your help in improving FactorioLab!

About

Angular-based calculator for factory games like Factorio and Dyson Sphere Program

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors