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

useState translation #521

Closed
wants to merge 10 commits into from
Closed

useState translation #521

wants to merge 10 commits into from

Conversation

r-m169
Copy link

@r-m169 r-m169 commented Aug 14, 2023

No description provided.

@r-m169
Copy link
Author

r-m169 commented Aug 14, 2023

I hope my request will be approved

@@ -4,7 +4,7 @@ title: useState

<Intro>

`useState` is a React Hook that lets you add a [state variable](/learn/state-a-components-memory) to your component.
`useState` هو Hook في React يتيح لك إضافة متغير حالة إلى مكونك
Copy link
Collaborator

Choose a reason for hiding this comment

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

في الصفحات الأخرى تم ترجمة كلمة hook إلى خطاف. يفضل أن تترجمها للتلائم مع باقي الصفحات

@@ -16,11 +16,12 @@ const [state, setState] = useState(initialState);

---

## Reference {/*reference*/}
## الإشارة الى المرجع {/*reference*/}
Copy link
Collaborator

Choose a reason for hiding this comment

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

تكفي كلمة "المرجع"

@github-actions
Copy link

github-actions bot commented Aug 20, 2023

Size changes

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@@ -32,33 +33,32 @@ function MyComponent() {
// ...
```

The convention is to name state variables like `[something, setSomething]` using [array destructuring.](https://javascript.info/destructuring-assignment)
التقليد هو تسمية متغيرات الحالة بشكل مثل `[something, setSomething]` باستخدام [array destructuring] [تفكيك الصفائف](https://javascript.info/destructuring-assignment)
Copy link
Collaborator

Choose a reason for hiding this comment

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

اعتدنا في الترجمة أني نترجم array إلى مصفوفة

@AhmedBaset
Copy link
Collaborator

I'll complete reviewing later.
I pushed some commits please review them.

Please read your translation again and rephrase what require

@r-m169
Copy link
Author

r-m169 commented Aug 21, 2023

when i pushed the changes i got "This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository."
Is it normal ?
I'm sorry about this stupid question, but this is the first time I've been dealing with open-source projects.

@AhmedBaset
Copy link
Collaborator

Here's the corrected version of your text with grammar and wording improvements:

Short: That happened because you rebased between commits.

TL;DR:
First, when you started translating, you edited the main branch. Then, you rebased the branch with the main repository using git pull.

If you're collaborating on a project with other developers (like this one), refrain from making direct edits to the main branch. Instead, create a new branch if you need to make edits:

# Create a new branch
git branch translating-use-state

# Switch to the new branch
git checkout translating-use-state

# Alternatively, you can combine the two previous commands into one
git checkout -b translating-use-state
# This will create a branch named "translating-use-state" and switch to it.

Make the necessary edits, and then commit them, as usual, using git add . and git commit -m "message". Afterward, push them using:

# When pushing the branch for the first time
git push -u origin translating-use-state
# After the first push
git push

This approach keeps your main branch untouched.

When you intend to start a new branch:

# Return to the main branch
git checkout main
# Create a new branch
git checkout -b translating-use-effect

I have a solution for your issue, but it might be complex and challenging for you. Therefore, consider deleting your forked repository, as you made edits directly to the main branch. Then, fork the repository again. In a separate directory on your computer, clone the repository again and create a new branch as instructed earlier. Copy your translation from this link and paste it at the end of this comment. Finally, open a new pull request

# Execute these commands one by one
git clone https://github.com/r-m169/ar.react.dev.git

# You'll now have a new directory named 'ar.react.dev'
cd ar.react.dev

# Open Visual Studio Code
code .

# Create a new branch and switch to it
git checkout -b translating-use-state

# Now copy the text from the link and paste it into 'src/content/reference/react/useState.md'
# Make your changes

# Then push the branch
git push -u origin translating-use-state

# Commit your changes
git add .
git commit -m "Translating useState reference"
git push

Your translation can be found here.

Let me know if you face a problem.

@r-m169 r-m169 closed this by deleting the head repository Sep 5, 2023
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.

2 participants