Functions by rskhan167 · Pull Request #75 · javascript-tutorial/hi.javascript.info
I have translated Functions. Please let me know if there are any changes/modifications needed. Thank you.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you have look at all the comments? Also have a re-look at the 1-js/02-first-steps/15-function-basics/article.md file, haven't review all of it. Needs some re-work. Thanks for the contribution. As you are maintaining the project now if you feel something is good enough to be merged feel free to merged even without another review. But make sure you do a proper self-review. Key here to just read the Hindi version and see if everything makes sense. After which you can read the English and Hindi side by side, to check for keywords and other guidelines. Thanks
| ``` | ||
|
|
||
| Rewrite it, to perform the same, but without `if`, in a single line. | ||
| इसे फिर से लिखें, वही प्रदर्शन करने के लिए, लेकिन बिना `if` के, एक पंक्ति में। |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use something more explicit than प्रदर्शन ? The translation doesn't need to match word by word if it's restricting us to convey the info.
| # Function min(a, b) | ||
|
|
||
| Write a function `min(a,b)` which returns the least of two numbers `a` and `b`. | ||
| एक function लिखें `min(a,b)` जो कम से कम दो नंबर `a` और `b` लौटाता है। |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you have a re-look at this line?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| # Function pow(x,n) | ||
|
|
||
| Write a function `pow(x,n)` that returns `x` in power `n`. Or, in other words, multiplies `x` by itself `n` times and returns the result. | ||
| एक function लिखें `pow(x,n)` जो `x` को `n` के शक्ति में लौटाता है। या, दूसरे शब्दों में, `x` को अपने आप से `n` गुणा से गुणा करता है और परिणाम देता है। |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line also needs to be re-looked. Let's try to use proper mathematical terms in Hindi
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| ``` | ||
|
|
||
| Create a web-page that prompts for `x` and `n`, and then shows the result of `pow(x,n)`. | ||
| एक वेब-पेज बनाएं जो `x` और `n` के लिए संकेत देता है, और फिर `pow(x,n)` का परिणाम दिखाता है। |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prompts is very contextual here, not sure if we should translate. Thoughts?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think you are right. It is better to keep it as is.
| [demo] | ||
|
|
||
| P.S. In this task the function should support only natural values of `n`: integers up from `1`. | ||
| नोट: इस टास्क में function को केवल `n` के प्राकृतिक मान का समर्थन करना चाहिए: `1` से ऊपर के पूर्णांक। |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above math terms are translated as plain old english.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| # Functions | ||
|
|
||
| Quite often we need to perform a similar action in many places of the script. | ||
| अक्सर हमें स्क्रिप्ट के कई स्थानों पर इसी तरह की कार्रवाई करने की आवश्यकता होती है। |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hindi sentence is a bit diverted from the meaning of the original sentence, that's what I feel. Can be improved.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| अक्सर हमें स्क्रिप्ट के कई स्थानों पर इसी तरह की कार्रवाई करने की आवश्यकता होती है। | ||
|
|
||
| For example, we need to show a nice-looking message when a visitor logs in, logs out and maybe somewhere else. | ||
| उदाहरण के लिए, जब कोई परिदर्शक इन करता है, लॉग आउट करता है और शायद कहीं और एक अच्छा दिखने वाला संदेश दिखाना चाहता है। |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| Functions प्रोग्राम के मुख्य "बिल्डिंग ब्लॉक्स" हैं। वे बिना दोहराव के कोड को कई बार कॉल करने की अनुमति देते हैं। | ||
|
|
||
| We've already seen examples of built-in functions, like `alert(message)`, `prompt(message, default)` and `confirm(question)`. But we can create functions of our own as well. | ||
| हम पहले से ही बिल्ट-इन function के उदाहरण देख चुके हैं, जैसे `अलर्ट (संदेश)`, `प्रॉम्प्ट (संदेश, डिफ़ॉल्ट)` और `पुष्टि करें (प्रश्न)`। लेकिन हम अपने स्वयं के functions भी बना सकते हैं। |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets not translate the keywords, anyting inside '``'
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes I somehow missed this
| ## Function Declaration | ||
|
|
||
| To create a function we can use a *function declaration*. | ||
| ## Function घोषणा |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be at line no 11
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| ``` | ||
|
|
||
| The `function` keyword goes first, then goes the *name of the function*, then a list of *parameters* between the parentheses (comma-separated, empty in the example above) and finally the code of the function, also named "the function body", between curly braces. | ||
| `function` कीवर्ड पहले जाता है, फिर _name of the function_ जाता है, फिर कोष्ठक के बीच _parameters_ की एक सूची (उपरोक्त उदाहरण में खाली) और अंत में function का कोड, जिसे "the function body" भी कहा जाता है , घुंघराले ब्रेसिज़ के बीच। |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we using a notation like - name of the function? Applies to all the places we are using it.
Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻
| ## Function घोषणा | ||
|
|
||
| It looks like this: | ||
| function बनाने के लिए हम एक _function declaration_ का उपयोग कर सकते हैं। |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we translate _function declaration_ also??
Can you have look at all the comments? Also have a re-look at the
1-js/02-first-steps/15-function-basics/article.mdfile, haven't review all of it. Needs some re-work. Thanks for the contribution. As you are maintaining the project now if you feel something is good enough to be merged feel free to merged even without another review. But make sure you do a proper self-review. Key here to just read the Hindi version and see if everything makes sense. After which you can read the English and Hindi side by side, to check for keywords and other guidelines. Thanks
Thanks for the review. I have made the requested changes also I have gone through 1-js/02-first-steps/15-function-basics/article.md file and made some changes there too. Please let me know if the changes are correct or not.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters