|
| 1 | +<div align=center> |
| 2 | + <img src="src/assets/icons/animated_java_fancy_icon_centered.svg" width=128/> |
| 3 | + <h1>🧑💻 Contributing to Animated Java</h1> |
| 4 | +</div> |
| 5 | + |
| 6 | +Contributions are always welcome, however, please consult @SnaveSutit before starting to avoid duplicates or misalignment of goals. I don't want you to waste all that time and effort on a PR that gets refused! <kbd>Thank you! ❤️</kbd> |
| 7 | + |
| 8 | +<br/> |
| 9 | + |
| 10 | +# 💻 Setting up the Development Environment |
| 11 | + |
| 12 | +### 🛠️ Prerequisites |
| 13 | + |
| 14 | +- #### Required |
| 15 | + |
| 16 | + - [Node.js](https://nodejs.org/en/) |
| 17 | + - [Yarn](https://classic.yarnpkg.com/lang/en/docs/install/#windows-stable) |
| 18 | + - [Git](https://git-scm.com/) |
| 19 | + |
| 20 | +- #### Recommended |
| 21 | + |
| 22 | + - [VSCode](https://code.visualstudio.com/) |
| 23 | + > (or any other code editor, but this project has configurations for VSCode) |
| 24 | + - [Blockbench](https://www.blockbench.net/) |
| 25 | + > The repository includes [Envbench](https://github.com/SnaveSutit/envbench) to create and manage a dev instance of Blockbench, So installing Blockbench separately is not strictly required. |
| 26 | + - [SnaveSutit's Blockbench Types](https://github.com/SnaveSutit/blockbench-types) |
| 27 | + > Bleeding edge types for Blockbench plugins.<br/>Install via `yarn add -D https://github.com/SnaveSutit/blockbench-types.git` |
| 28 | + - [GitButler](https://gitbutler.com/) |
| 29 | + > A Git client for simultaneous branches on top of your existing workflow. |
| 30 | +
|
| 31 | +## 🖇️ Cloning the Repository |
| 32 | + |
| 33 | +1. Clone the repository via git |
| 34 | + |
| 35 | + > [How do I clone a repository?](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) |
| 36 | +
|
| 37 | +2. Run `yarn install` to install dependencies. |
| 38 | + |
| 39 | +3. Open up `src/blockbenchTypes.d.ts` and replace the first line with the following: |
| 40 | + |
| 41 | + ```ts |
| 42 | + /// <reference types="blockbench-types"/> |
| 43 | + ``` |
| 44 | + |
| 45 | + > By default this references my local fork of the Blockbench types to quickly add / adjust types as needed. So you need to adjust this to the official Blockbench types, or your own fork, if you're not me. |
| 46 | + |
| 47 | +4. Run `yarn dev` to start the development environment, which will watch for changes and recompile the plugin. |
| 48 | + |
| 49 | +5. Open a new terminal, or click `Split` if you're in VSCode's terminal, and run `yarn start` to start the development instance of Blockbench. |
| 50 | + |
| 51 | +6. That's it! You're ready to start developing. |
| 52 | + |
| 53 | +> [!IMPORTANT] |
| 54 | +> Note that whenever you make changes, reloading just the plugins won't be enough, you must fully reload Blockbench for the plugin to function as expected.<br> |
| 55 | +> You can use <kbd><kbd>CTRL</kbd> + <kbd>SHIFT</kbd> + <kbd>R</kbd></kbd> |
| 56 | +> to reload Blockbench, or run `Blockbench.reload()` in the dev-tools console. |
| 57 | + |
| 58 | +## 💬 Adding Localizations |
| 59 | + |
| 60 | +1. Follow the instructions for [Cloning the Repository](#🖇️-cloning-the-repository). |
| 61 | + |
| 62 | +2. Duplicate `src/lang/en.yml` and rename it to match the language you're translating to. (e.g. `fr.yml` for French). |
| 63 | + |
| 64 | + > See [this page](https://github.com/JannisX11/blockbench/tree/master/lang) for the list of languages Blockbench supports. |
| 65 | + |
| 66 | +3. Start Translating! Make sure to check your changes in Blockbench to ensure they work correctly. |
| 67 | + |
| 68 | + > [!IMPORTANT] |
| 69 | + > You will see strings that have curly brackets surrounding a number (`{0}`) in them, these are placeholders that indicate where variables should inserted into a string. Make sure to keep them in your translations! |
| 70 | + |
| 71 | +4. Once you're done translating, open a pull request with your changes. |
0 commit comments