Files
gnome-night-theme-switcher/CONTRIBUTING.md
T
2020-09-23 12:23:57 +02:00

3.0 KiB

Contributing

You're welcome to contribute to the code or to the translations!


Table of contents


Contributing to the code

You'll need make and NPM to install the development dependencies:

make deps-install

Create a new branch describing what your're working on, for example feature/{name-of-the-feature} or theme/{name-of-the-theme}.

To make sure your code passes basic checks, run:

make test

When you're done, commit all your changes and create a new merge request. Choose the appropriate merge request template.

Coding style

We follow the GNOME Shell coding style and we use ESLint to enforce it.

To make sure your code follows it:

make test-lint

If you make changes to a file, please add your copyright notice at the top of the file, in the form Copyright (C) YEAR Your Name.

Themes and unit tests

If you add support for a theme, please write a unit test for each of its variants, in the tests directory, with the theme name as filename. Unit tests are written for AVA.

To run the tests:

make test-variants

Contributing to the translations

The extension uses Gettext for its localization. When working on a translation, create a new branch named translation/{language}.

Updating an existing translation

First update all the strings in the source code:

make pot

Then update the translations files:

make update-po

You can then edit the language you want in src/po/, either by hand or with a tool like GNOME Translation Editor.

When you're done, commit both the .pot file and the .po file you've worked on and create a new merge request.

Adding a new translation

First update all the strings in the source code:

make pot

Then run the following command, replacing {language-code} with the actual code of the language you want to add:

make add-po LANGUAGE_CODE={language-code}

You can then edit the new {language-code}.po file in src/po/, either by hand or with a tool like GNOME Translation Editor.

When you're done, commit both the .pot file and the .po file you've worked on and create a new merge request. Choose the appropriate merge request template.