mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-04 10:09:56 +03:00
122 lines
5.9 KiB
Plaintext
122 lines
5.9 KiB
Plaintext
# SOME DESCRIPTIVE TITLE.
|
|
# Copyright (C) 2014-2021, 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 3.4\n"
|
|
"Report-Msgid-Bugs-To: \n"
|
|
"POT-Creation-Date: 2021-12-21 17:14+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/cpp_usage_guidelines.rst:4
|
|
msgid "C++ usage guidelines"
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:7
|
|
msgid "Rationale"
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:9
|
|
msgid "Since Godot 4.0, the C++ standard used throughout the codebase is a subset of **C++17**. While modern C++ brings a lot of opportunities to write faster, more readable code, we chose to restrict our usage of C++ to a subset for a few reasons:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:14
|
|
msgid "It makes it easier to review code in online editors. This is because engine contributors don't always have access to a full-featured IDE while reviewing code."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:17
|
|
msgid "It makes the code easier to grasp for beginner contributors (who may not be professional C++ programmers). Godot's codebase is known to be easy to learn from, and we'd like to keep it that way."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:21
|
|
msgid "To get your pull request merged, it needs to follow the C++ usage guidelines outlined here. Of course, you can use features not allowed here in your own C++ modules or GDNative scripts."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:27
|
|
msgid "Prior to Godot 4.0, the C++ standard used throughout the codebase was C++03, with a handful of C++14 extensions. If you are contributing a pull request to the `3.x` branch rather than `master`, your code can't use C++17 features. Instead, your code must be able to be built with a C++14 compiler."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:32
|
|
msgid "The guidelines below don't apply to third-party dependencies, although we generally favor small libraries instead of larger solutions. See also :ref:`doc_best_practices_for_engine_contributors`."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:38
|
|
msgid "See :ref:`doc_code_style_guidelines` for formatting guidelines."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:41
|
|
msgid "Disallowed features"
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:43
|
|
msgid "**Any feature not listed below is allowed.** Using features like ``constexpr`` variables and ``nullptr`` is encouraged when possible. Still, try to keep your use of modern C++ features conservative. Their use needs to serve a real purpose, such as improving code readability or performance."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:49
|
|
msgid "Standard Template Library"
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:51
|
|
msgid "We don't allow using the `STL <https://en.wikipedia.org/wiki/Standard_Template_Library>`__ as Godot provides its own data types (among other things). See :ref:`doc_faq_why_not_stl` for more information."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:55
|
|
msgid "This means that pull requests should **not** use ``std::string``, ``std::vector`` and the like. Instead, use Godot's datatypes as described below:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:58
|
|
msgid "Use ``String`` instead of ``std::string``."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:59
|
|
msgid "Use ``Vector`` instead of ``std::vector``. In some cases, ``List`` or ``LocalVector`` can be used as an alternative (ask core developers first)."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:61
|
|
msgid "Use ``Array`` instead of ``std::array``."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:64
|
|
msgid "``auto`` keyword"
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:66
|
|
msgid "Please don't use the ``auto`` keyword for type inference. While it can avoid repetition, it can also lead to confusing code:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:77
|
|
msgid "Keep in mind hover documentation often isn't readily available for pull request reviewers. Most of the time, reviewers will use GitHub's online viewer to review pull requests."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:81
|
|
msgid "We chose to forbid ``auto`` instead of allowing it on a case-by-case basis to avoid having to decide on difficult edge cases. Thank you for your understanding."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:85
|
|
msgid "Lambdas"
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:87
|
|
msgid "Lambdas should be used conservatively when they make code effectively faster or simpler, and do not impede readability. Please ask before using lambdas in a pull request."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:92
|
|
msgid "``#pragma once`` directive"
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:94
|
|
msgid "To follow the existing style, please use standard ``#ifdef``-based include guards instead of ``#pragma once`` in new files."
|
|
msgstr ""
|
|
|
|
#: ../../docs/community/contributing/cpp_usage_guidelines.rst:99
|
|
msgid "See :ref:`doc_code_style_guidelines_header_includes` for guidelines on sorting includes in C++ and Objective-C files."
|
|
msgstr ""
|