shuashuai commented on code in PR #1403:
URL: https://github.com/apache/answer/pull/1403#discussion_r2446824561
##########
ui/src/pages/Questions/Ask/index.tsx:
##########
@@ -423,6 +425,24 @@ const Ask = () => {
usePageTags({
title: pageTitle,
});
+
+ const handleContentHint = () => {
+ if (
+ !writeInfo ||
+ writeInfo.min_content === undefined ||
+ !writeInfo.min_content
+ ) {
+ return t(`form.fields.body.hint.optional_body`);
+ }
+
+ let str: string = t(`form.fields.body.hint.minimum_characters`);
+ str = str.replace(
+ `{{ min_content_length }}`,
+ writeInfo.min_content.toString(),
+ );
+ return str;
Review Comment:
i18next can pass variables, {{}} is the placeholder for the variable
<img width="993" height="520" alt="image"
src="https://github.com/user-attachments/assets/6e6c7571-75da-45e1-8b13-ddb3d0e68dbe"
/>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]