-
-
Notifications
You must be signed in to change notification settings - Fork 23.3k
Update class reference contribution link. #110018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c7066ba
to
efdb433
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid hardcoding these values where possible. Some of the suggestions rectifying this rely on the following:
core/string/ustring.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp
index 7541598e06..3557bad5cc 100644
--- a/core/string/ustring.cpp
+++ b/core/string/ustring.cpp
@@ -5973,10 +5973,10 @@ String DTR(const String &p_text, const String &p_context) {
const String text = p_text.dedent().strip_edges();
if (TranslationServer::get_singleton()) {
- return String(TranslationServer::get_singleton()->doc_translate(text, p_context)).replace("$DOCS_URL", GODOT_VERSION_DOCS_URL);
+ return String(TranslationServer::get_singleton()->doc_translate(text, p_context)).replace("$DOCS_URL", GODOT_VERSION_DOCS_URL).replace("$CONTRIBUTE_URL", GODOT_VERSION_CONTRIBUTE_URL);
}
- return text.replace("$DOCS_URL", GODOT_VERSION_DOCS_URL);
+ return text.replace("$DOCS_URL", GODOT_VERSION_DOCS_URL).replace("$CONTRIBUTE_URL", GODOT_VERSION_CONTRIBUTE_URL);
}
/**
@@ -5990,14 +5990,14 @@ String DTRN(const String &p_text, const String &p_text_plural, int p_n, const St
const String text_plural = p_text_plural.dedent().strip_edges();
if (TranslationServer::get_singleton()) {
- return String(TranslationServer::get_singleton()->doc_translate_plural(text, text_plural, p_n, p_context)).replace("$DOCS_URL", GODOT_VERSION_DOCS_URL);
+ return String(TranslationServer::get_singleton()->doc_translate_plural(text, text_plural, p_n, p_context)).replace("$DOCS_URL", GODOT_VERSION_DOCS_URL).replace("$CONTRIBUTE_URL", GODOT_VERSION_CONTRIBUTE_URL);
}
// Return message based on English plural rule if translation is not possible.
if (p_n == 1) {
- return text.replace("$DOCS_URL", GODOT_VERSION_DOCS_URL);
+ return text.replace("$DOCS_URL", GODOT_VERSION_DOCS_URL).replace("$CONTRIBUTE_URL", GODOT_VERSION_CONTRIBUTE_URL);
}
- return text_plural.replace("$DOCS_URL", GODOT_VERSION_DOCS_URL);
+ return text_plural.replace("$DOCS_URL", GODOT_VERSION_DOCS_URL).replace("$CONTRIBUTE_URL", GODOT_VERSION_CONTRIBUTE_URL);
}
#endif
doc/tools/make_rst.py
Outdated
"There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!", | ||
"There is currently no description for this operator. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!", | ||
"There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!", | ||
"There is currently no description for this class. Please help us by `contributing one <https://contributing.godotengine.org/en/latest/documentation/class_reference/index.html>`__!", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really, really don't want us to have to use a hardcoded workaround like this. Will need @mhilbrunner to clarify if the original ref
can somehow be retained (maybe it's already retained?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did attempt to redirect the doc_updating_the_class_reference
ref name to an external link, but didn't succeed. I'm not sure if it's possible.
a78752b
to
5412a8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not crazy about the hardcoding, but for a 4.5-stable timeframe this is acceptable
5412a8f
to
527f4e9
Compare
Thanks! |
Cherry-picked for 4.4 |
Cherry-picked for 4.3 |
Cherry-picked for 4.2 |
Should be merged together with godotengine/godot-docs#11188.
There seem to be quite a lot of links 'hardcoded' in the
.po
files as well; those will need to be updated too. Not sure if that can be done by script.