Files
godot-docs-l10n/sphinx/templates/development/cpp/common_engine_methods_and_macros.pot
2022-09-09 16:05:06 +02:00

162 lines
7.5 KiB
Plaintext

# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2014-2022, 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.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-09-09 16:03+0200\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/development/cpp/common_engine_methods_and_macros.rst:4
msgid "Common engine methods and macros"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:6
msgid "Godot's C++ codebase makes use of dozens of custom methods and macros which are used in almost every file. This page is geared towards beginner contributors, but it can also be useful for those writing custom C++ modules."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:11
msgid "Print text"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:31
msgid "If you need to add placeholders in your messages, use format strings as described below."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:35
msgid "Format a string"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:37
msgid "The ``vformat()`` function returns a formatted :ref:`class_String`. It behaves in a way similar to C's ``sprintf()``:"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:51
msgid "In most cases, try to use ``vformat()`` instead of string concatenation as it makes for more readable code."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:55
msgid "Convert an integer or float to a string"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:57
msgid "This is mainly useful when printing numbers directly."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:68
msgid "Internationalize a string"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:70
msgid "There are two types of internationalization in Godot's codebase:"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:72
msgid "``TTR()``: **Editor (\"tools\") translations** will only be processed in the editor. If a user uses the same text in one of their projects, it won't be translated if they provide a translation for it. When contributing to the engine, this is generally the macro you should use for localizable strings."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:76
msgid "``RTR()``: **Run-time translations** will be automatically localized in projects if they provide a translation for the given string. This kind of translation shouldn't be used in editor-only code."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:87
msgid "To insert placeholders in localizable strings, wrap the localization macro in a ``vformat()`` call as follows:"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:97
msgid "When using ``vformat()`` and a translation macro together, always wrap the translation macro in ``vformat()``, not the other way around. Otherwise, the string will never match the translation as it will have the placeholder already replaced when it's passed to TranslationServer."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:103
msgid "Clamp a value"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:105
msgid "Godot provides macros for clamping a value with a lower bound (``MAX``), an upper bound (``MIN``) or both (``CLAMP``):"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:117
msgid "This works with any type that can be compared to other values (like ``int`` and ``float``)."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:121
msgid "Microbenchmarking"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:123
msgid "If you want to benchmark a piece of code but don't know how to use a profiler, use this snippet:"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:135
msgid "This will print the time spent between the ``begin`` declaration and the ``end`` declaration."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:140
msgid "You may have to ``#include \"core/os/os.h\"`` if it's not present already."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:142
msgid "When opening a pull request, make sure to remove this snippet as well as the include if it wasn't there previously."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:146
msgid "Get project/editor settings"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:148
msgid "There are four macros available for this:"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:160
msgid "If a default value has been specified elsewhere, don't specify it again to avoid repetition:"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:170
msgid "It's recommended to use ``GLOBAL_DEF``/``EDITOR_DEF`` only once per setting and use ``GLOBAL_GET``/``EDITOR_GET`` in all other places where it's referenced."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:174
msgid "Error macros"
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:176
msgid "Godot features many error macros to make error reporting more convenient."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:180
msgid "Conditions in error macros work in the **opposite** way of GDScript's built-in ``assert()`` function. An error is reached if the condition inside evaluates to ``true``, not ``false``."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:186
msgid "Only variants with custom messages are documented here, as these should always be used in new contributions. Make sure the custom message provided includes enough information for people to diagnose the issue, even if they don't know C++. In case a method was passed invalid arguments, you can print the invalid value in question to ease debugging."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:192
msgid "For internal error checking where displaying a human-readable message isn't necessary, remove ``_MSG`` at the end of the macro name and don't supply a message argument."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:196
msgid "Also, always try to return processable data so the engine can keep running well."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:240
msgid "See `core/error_macros.h <https://github.com/godotengine/godot/blob/3.x/core/error_macros.h>`__ in Godot's codebase for more information about each error macro."
msgstr ""
#: ../../docs/development/cpp/common_engine_methods_and_macros.rst:243
msgid "Some functions return an error code (materialized by a return type of ``Error``). This value can be returned directly from an error macro. See the list of available error codes in `core/error_list.h <https://github.com/godotengine/godot/blob/3.x/core/error_list.h>`__."
msgstr ""
#: ../../docs/<rst_epilog>:0
msgid "Translation status"
msgstr ""