reactjs / ar.react.dev

React documentation website in Arabic 📘⚛️ — وثائق React باللغة العربية
https://ar.react.dev
Creative Commons Attribution 4.0 International
134 stars 104 forks source link

useState translation #521

Closed r-m169 closed 1 year ago

r-m169 commented 1 year ago
r-m169 commented 1 year ago

I hope my request will be approved

github-actions[bot] commented 1 year ago

Size changes

## 📦 Next.js Bundle Analysis for react-dev This analysis was generated by the [Next.js Bundle Analysis action](https://github.com/hashicorp/nextjs-bundle-analysis). 🤖 This PR introduced no changes to the JavaScript bundle! 🙌
AhmedBaset commented 1 year ago

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

Please read your translation again and rephrase what require

r-m169 commented 1 year ago

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 commented 1 year ago

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.