GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Loops: while and for by mahdiHash · Pull Request #103 · javascript-tutorial/fa.javascript.info

Conversation

@mahdiHash

@mahdiHash mahdiHash commented Mar 30, 2021

Copy link
Copy Markdown
Contributor

Please read the description of task 7 "list primes"
Translation of "article.md" was a little tricky and some parts of translation may be weird so please review and comment / commit if you have anything better in mind

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mahdiHash added 23 commits March 28, 2021 14:27
@mahdiHash
Fix typos
665e392
line 11: `i++` -> `++i`  because it is `پیشوند`

line 18: `++i` -> `i++`  because it is `پسوند`
@mahdiHash
Translate solution.md of " 2-which-value-while"
8e5707f
Please review and comment / commit if anything is wrong
@mahdiHash
Translate task.md of "3-which-value-for"
c998f25
Please review and comment / commit if anything is wrong
@mahdiHash
Translate task.md of "3-which-value-for"
fc9698a
Please review and comment / commit if anything is wrong
@mahdiHash
Translate solution.md of "3-which-value-for"
8eb82e7
Please review and comment / commit if anything is wrong
@mahdiHash
Translate task.md of "4-for-even"
b61cbbe
Please review and comment / commit if anything is wrong
@mahdiHash
Translate solution.md of "4-for-even"
7930ad0
Please review and comment / commit if anything is wrong
@mahdiHash
Translate task.md of "5-replace-for-while"
77fc525
Please review and comment / commit if anything is wrong
@mahdiHash
Translate solution.md of "5-replace-for-while"
2a417e3
@mahdiHash
Translate task.md of "6-repeat-until-correct"
979c031
Please review and comment / commit if anything is wrong
@mahdiHash
Translate solution.md of "6-repeat-until-correct"
5794364
Please review and comment / commit if anything is wrong
@mahdiHash
Translate task.md (read description)
478e29c
I'm not sure of line 17 translation.
Please review and comment / commit if it could be better or anything is wrong
@mahdiHash
Translate first part of article.md
2d7c860
@mahdiHash
Merge pull request #1 from javascript-tutorial/master
4b3fcf6
Update my forked repo
@mahdiHash
Change a word
d702bed
Changed `می شود` to `شده` for reading purposes.
@mahdiHash
Translate second part of article.md
a4dca95
@mahdiHash
Translate third part of article.md
fafbb9a
@mahdiHash
Translate forth part of article.md
d091837
@mahdiHash
Translate 5th part of article.md
0261a80
@mahdiHash
Translate 6th part of article.md
b0d6e90
@mahdiHash
Translate article.md
ed966a3
The translation was a little tricky so please review and comment / commit if anything is wrong.
@mahdiHash
Change a word
bef5760
Changed "میشود" to "می شود"
@mahdiHash
Change two words
70c8c9e
Changed "میشود" to "می شود"
@javascript-translate-bot javascript-translate-bot added the review needed label Mar 30, 2021
@javascript-translate-bot
javascript-translate-bot requested a review from a team March 30, 2021 15:06
@javascript-translate-bot javascript-translate-bot mentioned this pull request Mar 30, 2021
Persian (Farsi) Translation Progress #1
Open
mahdyar
mahdyar requested changes Mar 30, 2021
View reviewed changes
Comment thread 1-js/02-first-steps/13-while-for/article.md Outdated
```

While the `condition` is truthy, the `code` from the loop body is executed.
تا وقتی که `condition` برابر با truthy باشد، `کد` قسمت بدنه حلقه اجرا می شود.

@mahdyar mahdyar Mar 30, 2021

Copy link
Copy Markdown
Member

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.

برابر با is not needed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mahdiHash reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread 1-js/02-first-steps/13-while-for/article.md Outdated
تا وقتی که `condition` برابر با truthy باشد، `کد` قسمت بدنه حلقه اجرا می شود.

For instance, the loop below outputs `i` while `i < 3`:
برای مثال، حلقه پایین `i` را نمایش می دهد تا وقتی که `i < 3`:

@mahdyar mahdyar Mar 30, 2021

Copy link
Copy Markdown
Member

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.

In Persian verb comes at the end, so It would be a better translation:
برای مثال، حلقه پایین `i` را تا وقتی که `i < 3` باشد، نمایش می‌دهد:

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mahdiHash reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread 1-js/02-first-steps/13-while-for/article.md Outdated
```

Let's learn the meaning of these parts by example. The loop below runs `alert(i)` for `i` from `0` up to (but not including) `3`:
بیایید معنی این قسمت ها را با مثال یاد بگیریم. حلقه زیر `alert(i)` را برای هر `i` از `0` تا `3` (اما شامل نمی شود) اجرا می کند:

@mahdyar mahdyar Mar 30, 2021

Copy link
Copy Markdown
Member

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.

(خود ۳ شامل نمی‌شود)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mahdiHash reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread 1-js/02-first-steps/13-while-for/article.md Outdated
```

Let's examine the `for` statement part-by-part:
بیایید دستور `for` را قسمت به قسمت بازرسی کنیم:

@mahdyar mahdyar Mar 30, 2021

Copy link
Copy Markdown
Member

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.

"Statement" doesn't mean دستور, using شرح would be a better idea.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mahdiHash reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@mahdyar mahdyar Mar 30, 2021

Copy link
Copy Markdown
Member

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.

Also using 'بررسی' instead of 'بازرسی' would be a better idea.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mahdiHash reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread 1-js/02-first-steps/13-while-for/article.md Outdated
یعنی اینکه، `begin` یک بار اجرا می شود، و سپس این تکرار می شود: بعد از هر بار آزمایش `condition`، `body` و `step` اجرا می شوند.

If you are new to loops, it could help to go back to the example and reproduce how it runs step-by-step on a piece of paper.
اگر شما در حلقه ها تازه وارد هستید، این می تواند کمک کند که به مثال برگردید و چگونگی اجرا شدن آن را مرحله به مرحله روی یک کاغذ بنویسید.

@mahdyar mahdyar Mar 30, 2021

Copy link
Copy Markdown
Member

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.

Don't translate literally, see what would look more natural in Persian, even if it's not the same words in English:
اگر تازه با حلقه‌ها آشنا شده اید، به مثال برگردید و بر روی یک تکه کاغذ مراحل اجرای آن را قدم به قدم بازتولید کنید.‍‍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mahdiHash reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread 1-js/02-first-steps/13-while-for/article.md Outdated
```

This makes the loop identical to `while (i < 3)`.
این کار حلقه را شبیه `while (i < 3)` می کند.

@mahdyar mahdyar Mar 30, 2021

Copy link
Copy Markdown
Member

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.

همسان/برابر با

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mahdiHash reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread 1-js/02-first-steps/13-while-for/article.md Outdated
```

Please note that the two `for` semicolons `;` must be present. Otherwise, there would be a syntax error.
لطفا در نظر داشته باشید که هر دو نقطه ویرگول `;` داخل `for` باید وجود داشته باشند. در غیر این صورت، یک ارور سینتکس به وجود خواهد آمد.

@mahdyar mahdyar Mar 30, 2021

Copy link
Copy Markdown
Member

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.

سینتکس ارور

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mahdiHash reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread 1-js/02-first-steps/13-while-for/article.md Outdated
لطفا در نظر داشته باشید که هر دو نقطه ویرگول `;` داخل `for` باید وجود داشته باشند. در غیر این صورت، یک ارور سینتکس به وجود خواهد آمد.

## Breaking the loop
## شکستن حلقه

@mahdyar mahdyar Mar 30, 2021

Copy link
Copy Markdown
Member

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.

متوقف‌کردن حلقه

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mahdiHash reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread 1-js/02-first-steps/13-while-for/article.md Outdated
اما ما می توانیم با استفاده از دستور خاص `break` آن را در هر لحظه مجبور به توقف کنیم.

For example, the loop below asks the user for a series of numbers, "breaking" when no number is entered:
برای مثال، حلقه زیر از کاربر یک سری عدد درخواست می کند، و زمانی که هیچ عددی وارد نشد "می شکند":

@mahdyar mahdyar Mar 30, 2021

Copy link
Copy Markdown
Member

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.

متوقف می‌شود

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mahdiHash reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread 1-js/02-first-steps/13-while-for/article.md Outdated
```

...it stops working: there's a syntax error.
...متوقف می شود: چون یک ارور سینتکس وجود دارد.

@mahdyar mahdyar Mar 30, 2021

Copy link
Copy Markdown
Member

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.

سینتکس ارور

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mahdiHash reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@javascript-translate-bot javascript-translate-bot removed the review needed label Mar 30, 2021
@javascript-translate-bot

javascript-translate-bot commented Mar 30, 2021

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@javascript-translate-bot javascript-translate-bot added the changes requested label Mar 30, 2021
@mahdiHash
Fix mentioned problems and change some lines
d421e8e
All the mentioned problems are fixed and I also changed some lines to make it more readable
@mahdiHash

mahdiHash commented Mar 30, 2021

Copy link
Copy Markdown
Contributor Author

Thank you @mahdyar for your review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mahdiHash

mahdiHash commented Mar 30, 2021

Copy link
Copy Markdown
Contributor Author

/done

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@javascript-translate-bot javascript-translate-bot added review needed and removed changes requested labels Mar 30, 2021
@javascript-translate-bot
javascript-translate-bot requested a review from a team March 30, 2021 17:34
mahdyar
mahdyar approved these changes Mar 30, 2021
View reviewed changes
@javascript-translate-bot javascript-translate-bot added needs +1 and removed review needed labels Mar 30, 2021
@mahdyar
mahdyar merged commit daf19aa into javascript-tutorial:master Mar 30, 2021
@javascript-translate-bot

javascript-translate-bot commented Mar 30, 2021

Copy link
Copy Markdown

Thank you 💖 I updated the Progress Issue #1 🎉 🎉 🎉

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@mahdyar mahdyar mahdyar approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

needs +1

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mahdiHash @javascript-translate-bot @mahdyar
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.