Files
godot-docs-l10n/sphinx/templates/community/contributing/code_style_guidelines.pot
2019-01-20 10:31:25 +01:00

215 lines
11 KiB
Plaintext

# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2014-2019, Juan Linietsky, Ariel Manzur and the Godot community (CC-BY 3.0)
# This file is distributed under the same license as the Godot Engine package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine latest\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-20 10:29+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../../docs/community/contributing/code_style_guidelines.rst:4
msgid "Code style guidelines"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:8
msgid "When contributing to Godot's source code, you will be expected to follow the style guidelines outlined below. Some of them are checked via the Continuous Integration process and reviewers will ask you to fix potential issues, so best setup your system as outlined below to ensure all your commits follow the guidelines."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:15
msgid "C++ and Objective-C"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:17
msgid "There are no written guidelines, but the code style agreed upon by the developers is enforced via the `clang-format <http://clang.llvm.org/docs/ClangFormat.html>`__ code beautifier, which takes care for you of all our conventions. To name a few:"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:22
msgid "Indentation and alignment are both tab based (respectively one and two tabs)"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:23
msgid "One space around math and assignments operators as well as after commas"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:24
msgid "Pointer and reference operators are affixed to the variable identifier, not to the type name"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:26
msgid "See further down regarding header includes"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:28
msgid "The rules used by clang-format are outlined in the `.clang-format <https://github.com/godotengine/godot/blob/master/.clang-format>`__ file of the Godot repository."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:32
msgid "As long as you ensure that your style matches the surrounding code and that you not introducing trailing whitespace or space-based indentation, you should be fine. If you plan to contribute regularly however, we strongly advise that you setup clang-format locally to check and automatically fix all your commits."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:37
msgid "Godot's code style should *not* be applied to thirdparty code, i.e. that is included in Godot's source tree but was not written specifically for our project. Such code usually come from different upstream projects with their own style guides (or lack thereof), and don't want to introduce differences that would make syncing with upstream repositories harder."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:44
msgid "Thirdparty code is usually included in the ``thirdparty/`` folder and can thus easily be excluded from formatting scripts. For the rare cases where a thirdparty code snippet needs to be included directly within a Godot file, you can use ``/* clang-format off */`` and ``/* clang-format on */`` to tell clang-format to ignore a chunk of code."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:52
msgid "Using clang-format locally"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:54
msgid "First of all, you will need to install clang-format. As of now, you need to use **clang-format 6.x** to be compatible with Godot's format. Later versions might be suitable, but previous versions had bugs that will cause formatting changes to the current code base."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:60
msgid "Installation"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:62
msgid "Here's how to install clang-format:"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:64
msgid "Linux: It will usually be available out-of-the-box with the clang toolchain packaged by your distribution. If your distro version is not the required one, you can download a pre-compiled version from the `LLVM website <http://releases.llvm.org/download.html>`__, or if you are on a Debian derivative, use the `upstream repos <http://apt.llvm.org/>`__."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:69
msgid "macOS and Windows: You can download precompiled binaries from the `LLVM website <http://releases.llvm.org/download.html>`__. You may need to add the path to the binary's folder to your system's ``PATH`` environment variable to be able to call ``clang-format`` out of the box."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:74
msgid "You then have different possibilities to apply clang-format to your changes:"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:77
msgid "Manual usage"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:79
msgid "You can apply clang-format manually one or more files with the following command:"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:86
msgid "``-i`` means that the changes should be written directly to the file (by default clang-format would only output the fixed version to the terminal)."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:88
msgid "The path can point to several files, either one after the other or using wildcards like in a typical Unix shell. Be careful when globbing so that you don't run clang-format on compiled objects (.o and .a files) that are in Godot's tree. So better use ``core/*.{cpp,h}`` than ``core/*``."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:94
msgid "Pre-commit hook"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:96
msgid "For ease of use, we provide a pre-commit hook for Git that will run clang-format automatically on all your commits to check them, and let you apply its changes in the final commit."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:100
msgid "This \"hook\" is a script which can be found in ``misc/hooks``, refer to that folder's README.md for installation instructions."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:103
msgid "If your clang-format is not in the ``PATH``, you may have to edit the ``pre-commit-clang-format`` to point to the correct binary for it to work. The hook was tested on Linux and macOS, but should also work in the Git Shell on Windows."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:109
msgid "IDE plugin"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:111
msgid "Most IDEs or code editors have beautifier plugins that can be configured to run clang-format automatically, for example each time you save a file."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:114
msgid "Here is a non-exhaustive list of beautifier plugins for some IDEs:"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:116
msgid "Qt Creator: `Beautifier plugin <http://doc.qt.io/qtcreator/creator-beautifier.html>`__"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:117
msgid "Visual Studio Code: `Clang-Format <https://marketplace.visualstudio.com/items?itemName=xaver.clang-format>`__"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:118
msgid "Visual Studio: `ClangFormat <https://marketplace.visualstudio.com/items?itemName=LLVMExtensions.ClangFormat>`__"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:119
msgid "vim: `vim-clang-format <https://github.com/rhysd/vim-clang-format>`__"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:121
msgid "(Pull requests welcome to extend this list with tested plugins.)"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:124
msgid "Header includes"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:126
msgid "When adding new C++ or Objective-C files or including new headers in existing ones, the following rules should be followed:"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:129
msgid "The first lines in the file should be Godot's copyright header and MIT license, copy-pasted from another file. Make sure to adjust the filename."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:131
msgid "In a ``.h`` header, include guards should be used with the form ``FILENAME_H``."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:134
msgid "In a ``.cpp`` file (e.g. ``filename.cpp``), the first include should be the one where the class is declared (e.g. ``#include \"filename.h\"``), followed by an empty line for separation."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:137
msgid "Then come headers from Godot's own code base, included in alphabetical order (enforced by ``clang-format``) with paths relative to the root folder. Those includes should be done with quotes, e.g. ``#include \"core/object.h\"``. The block of Godot header includes should then be followed by an empty line for separation."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:142
msgid "Finally, thirdparty headers (either from ``thirdparty`` or from the system's include paths) come next and should be included with the < and > symbols, e.g. ``#include <png.h>``. The block of thirdparty headers should also be followed by an empty line for separation."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:146
msgid "Godot and thirdparty headers should be included in the file that requires them, i.e. in the `.h` header if used in the declarative code or in the `.cpp` if used only in the imperative code."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:150
msgid "Example:"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:238
msgid "Java"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:240
msgid "Godot's Java code (mostly in ``platform/android``) is also enforced via ``clang-format``, so see the instructions above to set it up. Keep in mind that this style guide only applies to code written and maintained by Godot, not thirdparty code such as the ``java/src/com/google`` subfolder."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:246
msgid "Python"
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:248
msgid "Godot's SCons buildsystem is written in Python, and various scripts included in the source tree are also using Python."
msgstr ""
#: ../../docs/community/contributing/code_style_guidelines.rst:251
msgid "For those, we follow the `PEP-8 style guide <https://www.python.org/dev/peps/pep-0008/>`__, this is however not as strongly enforced as for the C++ code. If you are so inclined, you can check and format your Python changes using `autopep8 <https://pypi.org/project/autopep8/>`__."
msgstr ""