Skip to content
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

Functions #75

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open

Functions #75

wants to merge 41 commits into from

Conversation

rskhan167
Copy link
Contributor

I have translated Functions. Please let me know if there are any changes/modifications needed. Thank you.

@CLAassistant
Copy link

CLAassistant commented Sep 9, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@theBstar theBstar left a comment

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` के, एक पंक्ति में।
Copy link
Member

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.

@@ -4,13 +4,12 @@ importance: 1

# 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` लौटाता है।
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -4,16 +4,16 @@ importance: 4

# 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` गुणा से गुणा करता है और परिणाम देता है।
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


```js
pow(3, 2) = 3 * 3 = 9
pow(3, 3) = 3 * 3 * 3 = 27
pow(1, 100) = 1 * 1 * ...* 1 = 1
```

Create a web-page that prompts for `x` and `n`, and then shows the result of `pow(x,n)`.
एक वेब-पेज बनाएं जो `x` और `n` के लिए संकेत देता है, और फिर `pow(x,n)` का परिणाम दिखाता है।
Copy link
Member

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?

Copy link
Contributor Author

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` से ऊपर के पूर्णांक।
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -1,40 +1,42 @@
# Functions

Quite often we need to perform a similar action in many places of the script.
अक्सर हमें स्क्रिप्ट के कई स्थानों पर इसी तरह की कार्रवाई करने की आवश्यकता होती है।
Copy link
Member

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.

Copy link
Contributor Author

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.
उदाहरण के लिए, जब कोई परिदर्शक इन करता है, लॉग आउट करता है और शायद कहीं और एक अच्छा दिखने वाला संदेश दिखाना चाहता है।
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


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 भी बना सकते हैं।
Copy link
Member

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 '``'

Copy link
Contributor Author

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 घोषणा
Copy link
Member

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

Copy link
Contributor Author

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" भी कहा जाता है , घुंघराले ब्रेसिज़ के बीच।
Copy link
Member

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.

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻


It looks like this:
function बनाने के लिए हम एक _function declaration_ का उपयोग कर सकते हैं।
Copy link
Contributor Author

@rskhan167 rskhan167 Sep 21, 2021

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??

@rskhan167
Copy link
Contributor Author

/done

@rskhan167
Copy link
Contributor Author

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants