Skip to content
Flávio Monteiro edited this page Jul 16, 2016 · 20 revisions

Getting started

Before getting started with translation, it's recommended to install a .po file editor (e.g. Poedit). This helps you write a translation file in the correct format and make it easier to see what is not yet translated and what is already translated.

First you have to create .po file from the OpenSpades .pot file.

  • The .pot file is called a template file, and contains the translatable texts.
  • The generated .po file will contain your translation.

Then, you can start your translation and when done, submit it to the GitHub repository using a pull request

Note: If you don't have yet, register a GitHub account so you can submit your pull request.

Note 2: If you don't have any Git/GitHub experience, read those first:

  1. https://guides.github.com/activities/hello-world/
  2. https://guides.github.com/activities/forking/

Optionally, if you wish to get into advanced Git, then read The Git Documentation (takes some time)

Forking the repository

You can skip this step if you wish to clone the repository directly, but I recommend to fork it first so you can submit the pull request using the GitHub website interface, which I find easier to do.

Go to the OpenSpades repository page and click "fork" at the upper right corner.

Now you've successfully forked the repository.

Note: You can delete the fork later, after you're finished with the translations.

Cloning your fork

If you don't have it yet, install git.

Then, clone your fork at a directory of your choice.

git clone https://github.com/*yourUsername*/openspades.git

Finding the .pot

Now that you cloned the repository into your computer:

  1. Navigate to the cloned repository folder
  2. Go to Resources/Locales/Pot/
  3. There you'll find the openspades.pot file 😄

Translating

Create a new directory inside Resources/Locales/ with you language code. (e.g. en, pt_BR)

  • If you are using Poedit
  • Open the .pot file with Poedit
  • Save the generated .po in the newly created directory. (e.g. en, pt_BR)
  • Edit the file anytime you want and submit the translation when finished.
  • If you are using a common text editor (e.g. Notepad++, Geany, Gedit, Vim, Emacs)
  • Copy the .pot file to your newly created directory (e.g. en, pt_BR)
  • Change the extension from .pot to .po
  • Edit the file anytime you want and submit the translation when finished.

Uploading the changes to your fork

  1. Add the changed file

git add Resources/Locales/*LANGUAGE*/openspades.po

  1. Commit

git commit -m "Add Klingon language"

  1. Upload to our fork

git push

Submitting a pull request

If you haven't, please read Forking tutorial

  1. Navigate to your forked repository inside GitHub.
  2. GitHub will say you can submit a pull request
  3. Submit it
  4. Wait for it to be approved

That's it 👍

Note (update-pot.sh still has to be explained)