From 0ba08a116217a56ca8e8d8e0047f179934ed9b89 Mon Sep 17 00:00:00 2001 From: "Hamid R. K. Pisghadam" Date: Tue, 31 Oct 2023 16:51:10 +0330 Subject: [PATCH 01/23] Translate and Fix LTR --- po/fa.po | 443 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 326 insertions(+), 117 deletions(-) diff --git a/po/fa.po b/po/fa.po index 3aea7c3bdaa3..49f0aa27bf43 100644 --- a/po/fa.po +++ b/po/fa.po @@ -299,7 +299,7 @@ msgstr "های جابجا شده در Rust String" #: src/SUMMARY.md:92 msgid "Double Frees in Modern C++" -msgstr "آزاد سازی مضاعف در مدرن سی++" +msgstr "آزاد سازی مضاعف درC++ مدرن" #: src/SUMMARY.md:93 src/ownership/moves-function-calls.md:1 msgid "Moves in Function Calls" @@ -689,7 +689,7 @@ msgstr "فراخوانی Rust از C" #: src/SUMMARY.md:210 src/android/interoperability/cpp.md:1 msgid "With C++" -msgstr "با ++C" +msgstr "با C++" #: src/SUMMARY.md:211 msgid "With Java" @@ -1108,7 +1108,8 @@ msgid "" "development (AOSP). This includes interoperability with C, C++, and Java." msgstr "" "[Android](android.md): دوره نیم روزه استفاده از Rust برای پلتفرم " -"اندرویدتوسعه (AOSP). این شامل قابلیت همکاری با C، C++ و جاوا می شود." +"اندرویدتوسعه (AOSP). این شامل قابلیت همکاری با C، C++ و " +"جاوا می شود." #: src/index.md:28 msgid "" @@ -1166,8 +1167,8 @@ msgid "" msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. Rust یک زبان استاتیک تایپ ." "است \n" -"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم تا رویکرد‌های Rust را " -"بهتر توضیح دهیم یا در در حالت مقایسه با آن قرار دهیم." +"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم " +"تا رویکرد‌های Rust را بهتر توضیح دهیم یا در در حالت مقایسه با آن قرار دهیم." #: src/index.md:52 msgid "" @@ -1368,7 +1369,7 @@ msgid "" msgstr "" "در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد " "استفاده از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت " -"تعاملبا C، C++ و جاوا می شود." +"تعاملبا C، C++ و جاوا می شود." #: src/running-the-course/course-structure.md:25 msgid "" @@ -2052,37 +2053,39 @@ msgstr "" #: src/welcome-day-1.md:1 msgid "Welcome to Day 1" -msgstr "به روز 1 خوش آمدید" +msgstr "به روز ۱ خوش آمدید" #: src/welcome-day-1.md:3 msgid "" "This is the first day of Rust Fundamentals. We will cover a lot of ground " "today:" msgstr "" -"این اولین روز از Rust Fundamentals است. ما امروز زمینه های زیادی را پوشش " -"خواهیم داد:" +"این اولین روز از مبانی Rust است. ما امروز بخش‌های فابل توجه‌ای را پوشش خواهیم " +"داد:" #: src/welcome-day-1.md:6 msgid "" "Basic Rust syntax: variables, scalar and compound types, enums, structs, " "references, functions, and methods." msgstr "" -"Basic Rust syntax: variables, scalar و compound types, enums, structs, " -"references, functions, and methods." +" سینتکس‌های مقدماتی: متغییرها, تایپ‌های عددی و تایپ‌های مرکب, enums, structs, " +"مراجع, توابع, و متدها." #: src/welcome-day-1.md:9 msgid "" "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, and " "`continue`." msgstr "" +"سازوکارهای جریان کنترل: `if`, `if let`, `while`, `while let`, `break` و " +"`continue`. " #: src/welcome-day-1.md:12 msgid "Pattern matching: destructuring enums, structs, and arrays." -msgstr "" +msgstr "تطابق الگو: تجزیه و تحلیل enums, structsو arrays." #: src/welcome-day-1.md:16 msgid "Please remind the students that:" -msgstr "لطفا به دانش آموزان یادآوری کنید:" +msgstr "لطفا به دانشجویان یادآوری کنید:" #: src/welcome-day-1.md:18 msgid "" @@ -2094,7 +2097,7 @@ msgstr "" msgid "" "The class is meant to be interactive and discussions are very much " "encouraged!" -msgstr "کلاس قرار است تعاملی باشد و بحث ها بسیار مورد تشویق قرار می گیرند!" +msgstr "کلاس قرار است تعاملی باشد و بحث‌ها بسیار مورد تشویق قرار می گیرند!" #: src/welcome-day-1.md:20 msgid "" @@ -2132,10 +2135,9 @@ msgid "" "speak about the famous borrow checker. The way Rust handles memory is a " "major feature and we should show students this right away." msgstr "" -"ایده روز اول این است که _به اندازه کافی_ از Rust نشان داده شود تا بتوانیتا " -"بتوانید در مورد borrow checker .راهی که رااست برای مدیریت حافظه انجام می " -"دهد یک معروف صحبت کنیدمزیت بزرگی است و ما باید این را فوراً به دانش آموزان " -"نشان دهیم." +"ایده برای روز اول این است که فقط به اندازه کافی از Rust را نشان دهیم تا " +"بتوانیم در مورد بررسی کننده قرض `borrow checker` معروف صحبت کنیم.نحوه مدیریت " +"حافظه توسط Rust یک ویژگی مهم استو باید آن را بلافاصله به دانشجویان نشان دهیم." #: src/welcome-day-1.md:33 msgid "" @@ -2143,22 +2145,24 @@ msgid "" "schedule. We suggest splitting the day into two parts (following the slides):" msgstr "" "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در کلاس " -"درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم کنید(اسلابد ها را " +"درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم کنید(اسلاید‌ها را " "دنبال کنید)" #: src/welcome-day-1.md:36 msgid "Morning: 9:00 to 12:00," -msgstr "صبح : 9:00 تا 12:00" +msgstr "صبح : ۹:۰۰ تا ۱۲:۰۰" #: src/welcome-day-1.md:37 msgid "Afternoon: 13:00 to 16:00." -msgstr "بعد از ظهر: 13:00 تا 16:00" +msgstr "بعد از ظهر: ۱۳:۰۰ تا ۱۶:۰۰" #: src/welcome-day-1.md:39 msgid "" "You can of course adjust this as necessary. Please make sure to include " "breaks, we recommend a break every hour!" msgstr "" +"البته می توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " +"را نیز درنظر بگیرید، ما توصیه می کنیم هر ساعت یک استراحت داشته باشید!" #: src/welcome-day-1/what-is-rust.md:3 msgid "" @@ -2169,54 +2173,56 @@ msgstr "" #: src/welcome-day-1/what-is-rust.md:5 msgid "Rust is a statically compiled language in a similar role as C++" msgstr "" +"زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ دارد." #: src/welcome-day-1/what-is-rust.md:6 msgid "`rustc` uses LLVM as its backend." -msgstr "" +msgstr "`rustc` از `LLVM` به عنوان بک‌اند خود استفاده می‌کند." #: src/welcome-day-1/what-is-rust.md:7 msgid "" "Rust supports many [platforms and architectures](https://doc.rust-lang.org/" "nightly/rustc/platform-support.html):" msgstr "" -" رااست از بسیاری از [بسترها و معماری ها](https://doc.rust-lang.org/nightly/" +" راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/" "rustc/platform-support.html) پشتیبانی می کند :" #: src/welcome-day-1/what-is-rust.md:9 msgid "x86, ARM, WebAssembly, ..." -msgstr "x86, ARM, WebAssembly, ..." +msgstr "x86, ARM, WebAssembly, ..." #: src/welcome-day-1/what-is-rust.md:10 msgid "Linux, Mac, Windows, ..." -msgstr "Linux, Mac, Windows, ..." +msgstr "Linux, Mac, Windows, ..." #: src/welcome-day-1/what-is-rust.md:11 msgid "Rust is used for a wide range of devices:" -msgstr ":رااست برای طیف گسترده ای از دستگاه ها استفاده می شود" +msgstr ":راست برای طیف گسترده ای از دستگاه‌ها استفاده می شود" #: src/welcome-day-1/what-is-rust.md:12 msgid "firmware and boot loaders," -msgstr "" +msgstr "میان‌افزار (firmware) و بوت‌لودرها (boot loaders)" #: src/welcome-day-1/what-is-rust.md:13 msgid "smart displays," -msgstr "" +msgstr "نمایشگر‌های هوشمند" #: src/welcome-day-1/what-is-rust.md:14 msgid "mobile phones," -msgstr "" +msgstr "تلفن همراه" #: src/welcome-day-1/what-is-rust.md:15 msgid "desktops," -msgstr "" +msgstr "دسکتاپ" #: src/welcome-day-1/what-is-rust.md:16 msgid "servers." -msgstr "" +msgstr "سرورها" #: src/welcome-day-1/what-is-rust.md:21 msgid "Rust fits in the same area as C++:" -msgstr "" +msgstr "Rust در همان حوزه C++ قرار می گیرد:" #: src/welcome-day-1/what-is-rust.md:23 msgid "High flexibility." @@ -2229,21 +2235,23 @@ msgstr "" #: src/welcome-day-1/what-is-rust.md:25 msgid "" "Can be scaled down to very constrained devices such as microcontrollers." -msgstr "" +msgstr "می‌تواند به دستگاه‌های بسیار محدود مانند میکروکنترلرها مقیاس‌بندی شود." #: src/welcome-day-1/what-is-rust.md:26 msgid "Has no runtime or garbage collection." -msgstr "" +msgstr " فاقد ران‌تایم (runtime) یا جمع‌آوری زباله (garbage collection) است." #: src/welcome-day-1/what-is-rust.md:27 msgid "Focuses on reliability and safety without sacrificing performance." -msgstr "" +msgstr "بر قابلیت اطمینان و ایمنی بدون قربانی کردن عملکرد تمرکز دارد." #: src/hello-world.md:3 msgid "" "Let us jump into the simplest possible Rust program, a classic Hello World " "program:" msgstr "" +"بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک " +"بپردازیم:" #: src/hello-world.md:6 msgid "" @@ -2256,27 +2264,33 @@ msgstr "" #: src/hello-world.md:12 msgid "What you see:" -msgstr "" +msgstr "شما چه چیزی‌ رو می‌بینید؟" #: src/hello-world.md:14 msgid "Functions are introduced with `fn`." -msgstr "" +msgstr " توابع با `fn` معرفی می‌شوند." #: src/hello-world.md:15 msgid "Blocks are delimited by curly braces like in C and C++." msgstr "" +"بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود " +"می‌شوند." #: src/hello-world.md:16 msgid "The `main` function is the entry point of the program." -msgstr "" +msgstr "تابع `main` نقطه ورود برنامه است." #: src/hello-world.md:17 msgid "Rust has hygienic macros, `println!` is an example of this." msgstr "" +"زبان Rust دارای ماکروهای ترتمیز است، `println!` یک " +"نمونه از این است." #: src/hello-world.md:18 msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." msgstr "" +"رشته‌های Rust با انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر Unicode " +"باشند." #: src/hello-world.md:22 msgid "" @@ -2284,22 +2298,30 @@ msgid "" "see a ton of it over the next three days so we start small with something " "familiar." msgstr "" +"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز " +"آینده خیلی از این کدها خواهند دید، بنابراین با چیز آشنا شروع می کنیم.." #: src/hello-world.md:27 msgid "" "Rust is very much like other languages in the C/C++/Java tradition. It is " "imperative and it doesn't try to reinvent things unless absolutely necessary." msgstr "" +"زبان Rust, زبان بسیار شبیه به سایر زبان‌های خانواده C/C++/Java است.یک زبان امری است (imperative) و سعی نمی کند چیزی را مگر اینکه " +"کاملاً ضروری باشد، دوباره اختراع کند." #: src/hello-world.md:31 msgid "Rust is modern with full support for things like Unicode." -msgstr "" +msgstr "زبان Rust, یک زبان مدرن با پشتیبانی کامل از چیزهایی مانند Unicode است." #: src/hello-world.md:33 msgid "" "Rust uses macros for situations where you want to have a variable number of " "arguments (no function [overloading](basic-syntax/functions-interlude.md))." msgstr "" +"Rust از ماکروها برای موقعیت‌هایی استفاده می‌کند که می‌خواهید تعداد متغیری از " +"آرگومان‌ها داشته باشید (بدون [اورلودینگ](basic-syntax/functions-interlude.md) " +"تابع)." #: src/hello-world.md:36 msgid "" @@ -2308,6 +2330,10 @@ msgid "" "hygienic](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene." "html)." msgstr "" +"«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی " +"شناسه‌ها را از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند.ماکروهای Rust در " +"واقع فقط [تا حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/" +"minutiae/hygiene.html هستند." #: src/hello-world.md:40 msgid "" @@ -2316,10 +2342,14 @@ msgid "" "while it is not a functional language, it includes a range of [functional " "concepts](https://doc.rust-lang.org/book/ch13-00-functional-features.html)." msgstr "" +"زبان Rust, یک زبان چند پارادایمی است. به عنوان مثال، دارای ویژگی‌های قدرتمند " +"[برنامه نویسی شی گرا](https://doc.rust-lang.org/book/ch17-00-oop.html) است و " +"در حالی که یک زبان تابعی(`functional‍`) نیست، شامل طیف وسیعی از [مفاهیم تابعی]" +"(https://doc.rust-lang.org/book/ch13-00-functional-features.html) است." #: src/hello-world/small-example.md:3 msgid "Here is a small example program in Rust:" -msgstr "" +msgstr "یک برنامه کوچیک در Rust:" #: src/hello-world/small-example.md:5 msgid "" @@ -2339,6 +2369,21 @@ msgid "" "}\n" "```" msgstr "" +"```rust,editable\n" +"fn main() { // نقطه ورودی برنامه\n" +" let mut x: i32 = 6; //انتساب متغییر قابل تغییر\n" +" print!(\"{x}\"); // ماکرویی برای پرینت به مانند printf\n" +" while x != 1 { // هیچ پرانتزی دور دستور نیست\n" +" if x % 2 == 0 { // دستور Math به مانند بقیه زبان ها \n" +" x = x / 2;\n" +" } else {\n" +" x = 3 * x + 1;\n" +" }\n" +" print!(\" -> {x}\");\n" +" }\n" +" println!();\n" +"}\n" +"```" #: src/hello-world/small-example.md:23 msgid "" @@ -2346,6 +2391,9 @@ msgid "" "will always end, but this is not yet proved. Edit the code and play with " "different inputs." msgstr "" +"این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر این " +"است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را ویرایش کنید " +"و با ورودی‌های مختلف بازی کنید." #: src/hello-world/small-example.md:29 msgid "" @@ -2353,22 +2401,29 @@ msgid "" "trigger type inference. Try with `i8` instead and trigger a runtime integer " "overflow." msgstr "" +"توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف کنید " +"تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز (`overflow`) عدد " +"صحیح در زمان اجرا را فعال کنید.." #: src/hello-world/small-example.md:32 msgid "Change `let mut x` to `let x`, discuss the compiler error." -msgstr "" +msgstr "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." #: src/hello-world/small-example.md:34 msgid "" "Show how `print!` gives a compilation error if the arguments don't match the " "format string." msgstr "" +"نشان دهید که چگونه `print!` در صورت عدم تطابق آرگومان‌ها " +"با قالب رشته (`format string`) ، خطای کامپایل می دهد." #: src/hello-world/small-example.md:37 msgid "" "Show how you need to use `{}` as a placeholder if you want to print an " "expression which is more complex than just a single variable." msgstr "" +"نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده تر از یک متغیر واحد " +"است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." #: src/hello-world/small-example.md:40 msgid "" @@ -2376,34 +2431,41 @@ msgid "" "fmt` which has the rules of the formatting mini-language. It's important " "that the students become familiar with searching in the standard library." msgstr "" +"کتابخانه استاندارد را به دانشجویان نشان دهید، به آنها نشان دهید که چگونه " +"`std::fmt` را که قوانین زبان-کوچک قالب بندی را دارد جستجو کنند. مهم است که " +"دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." #: src/hello-world/small-example.md:44 msgid "" "In a shell `rustup doc std::fmt` will open a browser on the local std::fmt " "documentation" msgstr "" +"در یک خط‌‌‌‌فرمان (`shell`) دستور `rustup doc std::fmt` را بزنید تا مستندات محلی " +"‍`std::fmt` را توی مرورگری کند." #: src/why-rust.md:3 msgid "Some unique selling points of Rust:" -msgstr "" +msgstr "برخی از نقاط قوت منحصر به فرد زبان Rust:" #: src/why-rust.md:5 msgid "Compile time memory safety." -msgstr "" +msgstr "ایمنی حافظه در زمان کامپایل." #: src/why-rust.md:6 msgid "Lack of undefined runtime behavior." -msgstr "" +msgstr "عدم وجود رفتار نامشخص در زمان اجرا." #: src/why-rust.md:7 msgid "Modern language features." -msgstr "" +msgstr "ویژگی‌های زبانی مدرن." #: src/why-rust.md:11 msgid "" "Make sure to ask the class which languages they have experience with. " "Depending on the answer you can highlight different features of Rust:" msgstr "" +"حتما از کلاس بپرسید که با چه زبان‌هایی تجربه دارند. بسته به پاسخ، می توانید " +"ویژگی‌های مختلف Rust را برجسته کنید::" #: src/why-rust.md:14 msgid "" @@ -2412,6 +2474,11 @@ msgid "" "have the memory unsafety issues. In addition, you get a modern language with " "constructs like pattern matching and built-in dependency management." msgstr "" +"تجربه با C یا C++ : زبان Rust با استفاده از بررسی کننده " +"وام گیری (اشاره به مبحث قرض گرفتن یا `borrow`) ، یک سری کامل از _خطاهای " +"زمان اجرا_ را از بین می برد.t عملکردی مانند C و C++ را " +"دارید اما مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن " +"با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می کنید." #: src/why-rust.md:19 msgid "" @@ -2420,10 +2487,15 @@ msgid "" "addition you get fast and predictable performance like C and C++ (no garbage " "collector) as well as access to low-level hardware (should you need it)" msgstr "" +"تجربه با Java، Go، Python، JavaScript...: شما همان ایمنی حافظه را مانند آن " +"زبان‌ها دریافت می‌کنید، به علاوه یک احساس زبان سطح بالا مشابه. علاوه بر این، " +"شما عملکرد سریع و قابل پیش‌بینی مانند C و C++ (بدون " +"جمع‌آوری زباله) و همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت " +"می‌کنید." #: src/why-rust/an-example-in-c.md:4 msgid "Let's consider the following \"minimum wrong example\" program in C:" -msgstr "" +msgstr "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" #: src/why-rust/an-example-in-c.md:6 msgid "" @@ -2472,55 +2544,55 @@ msgstr "" #: src/why-rust/an-example-in-c.md:48 msgid "How many bugs do you spot?" -msgstr "" +msgstr "چند باگ پیدا می کنید؟" #: src/why-rust/an-example-in-c.md:52 msgid "" "Despite just 29 lines of code, this C example contains serious bugs in at " "least 11:" -msgstr "" +msgstr "با وجود تنها ۲۹ خط کد، این مثال C حداقل 11 باگ جدی دارد: " #: src/why-rust/an-example-in-c.md:54 msgid "Assignment `=` instead of equality comparison `==` (line 28)" -msgstr "" +msgstr "تخصیص `=` به جای مقایسه برابری `==` (خط ۲۸)" #: src/why-rust/an-example-in-c.md:55 msgid "Excess argument to `printf` (line 23)" -msgstr "" +msgstr "ارگمان اضافی به `printf` (خط ۲۳)" #: src/why-rust/an-example-in-c.md:56 msgid "File descriptor leak (after line 26)" -msgstr "" +msgstr "نشت توصیفگر فایل (`File descriptor`) (پس از خط ۲۶)" #: src/why-rust/an-example-in-c.md:57 msgid "Forgotten braces in multi-line `if` (line 22)" -msgstr "" +msgstr "فراموشی پرانتز در `if` چند خطی (خط ۲۲)" #: src/why-rust/an-example-in-c.md:58 msgid "Forgotten `break` in a `switch` statement (line 32)" -msgstr "" +msgstr "فراموشی `break` در `switch` (خط ۳۲)" #: src/why-rust/an-example-in-c.md:59 msgid "" "Forgotten NUL-termination of the `buf` string, leading to a buffer overflow " "(line 29)" -msgstr "" +msgstr "فراموشی خاتمه `NUL` رشته `buf`، منجر به سرریز بافر (خط ۲۹) " #: src/why-rust/an-example-in-c.md:60 msgid "Memory leak by not freeing the `malloc`\\-allocated buffer (line 21)" -msgstr "" +msgstr "نشت حافظه با آزاد نکردن بافر اختصاص داده شده توسط `malloc` (خط ۲۱)" #: src/why-rust/an-example-in-c.md:61 msgid "Out-of-bounds access (line 17)" -msgstr "" +msgstr "دسترسی خارج از محدوده (خط ۱۷)" #: src/why-rust/an-example-in-c.md:62 msgid "Unchecked cases in the `switch` statement (line 11)" -msgstr "" +msgstr "حالات بررسی نشده در `switch` (خط ۱۱)" #: src/why-rust/an-example-in-c.md:63 msgid "Unchecked return values of `stat` and `fopen` (lines 18 and 26)" -msgstr "" +msgstr "مقادیر برگشتی از `stat` و `fopen` بررسی نشده (خطوط ۱۸ و ۲۶)" #: src/why-rust/an-example-in-c.md:65 msgid "" @@ -2528,6 +2600,9 @@ msgid "" "No, surprisingly this code compiles warning-free at the default warning " "level, even in the latest GCC version (13.2 as of writing)." msgstr "" +"_آیا این باگها نباید برای یک کامپایلر C نمایان باشد؟_ \n" +"نه، به طور شگفت انگیزی این کد بدون هیچ هشدار در سطح هشدار(`warning`) پیش فرض " +"کامپایل می شود، حتی در آخرین نسخه GCC (۱۳.۲ این کتاب در زمان نوشتن)." #: src/why-rust/an-example-in-c.md:68 msgid "" @@ -2535,6 +2610,9 @@ msgid "" "Absolutely not, these kind of bugs have lead to serious security " "vulnerabilities in the past. Some examples:" msgstr "" +"_آیا این یک مثال خیلی غیر واقعی نیست؟_ \n" +"ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی شده‌اند. " +"چند نمونه:" #: src/why-rust/an-example-in-c.md:71 msgid "" @@ -2542,12 +2620,16 @@ msgid "" "Attempt of 2003](https://freedom-to-tinker.com/2013/10/09/the-linux-backdoor-" "attempt-of-2003)" msgstr "" +"تخصیص `=` به جای مقایسه برابر بودن `==`: [The Linux Backdoor Attempt of 2003]" +"(https://freedom-to-tinker.com/2013/10/09/the-linux-backdoor-attempt-of-2003)" #: src/why-rust/an-example-in-c.md:72 msgid "" "Forgotten braces in multi-line `if`: [The Apple goto fail vulnerability]" "(https://dwheeler.com/essays/apple-goto-fail.html)" msgstr "" +"فراموشی پرانتز در `if` چند خطی: [The Apple goto fail vulnerability](https://" +"dwheeler.com/essays/apple-goto-fail.html)" #: src/why-rust/an-example-in-c.md:73 msgid "" @@ -2555,54 +2637,67 @@ msgid "" "(https://nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-hole-the-" "break-that-broke-sudo)" msgstr "" +"فراموشی گذاشتن `break` در `switch`: [The break that broke sudo]" +"(https://nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-hole-the-" +"break-that-broke-sudo) " #: src/why-rust/an-example-in-c.md:75 msgid "" "_How is Rust any better here?_ \n" "Safe Rust makes all of these bugs impossible:" msgstr "" +"_چطوری زبان راست در اینجا بهتر عمل میکند?_ \n" +"راست ایمن تمام این باگ‌ها را غیرممکن می کند:" #: src/why-rust/an-example-in-c.md:78 msgid "Assignments inside an `if` clause are not supported." -msgstr "" +msgstr "تخصیص‌ها در داخل یک شرط `if` پشتیبانی نمی‌شوند." #: src/why-rust/an-example-in-c.md:79 msgid "Format strings are checked at compile-time." -msgstr "" +msgstr "قالب‌بندی رشته‌ها در زمان کامپایل بررسی می‌شوند." #: src/why-rust/an-example-in-c.md:80 msgid "Resources are freed at the end of scope via the `Drop` trait." -msgstr "" +msgstr "منابع در پایان دامنه از طریق ویژگی `Drop` آزاد می‌شوند." #: src/why-rust/an-example-in-c.md:81 msgid "All `if` clauses require braces." -msgstr "" +msgstr "همه شرط‌های `if` نیاز به پرانتز دارند." #: src/why-rust/an-example-in-c.md:82 msgid "" "`match` (as the Rust equivalent to `switch`) does not fall-through, hence " "you can't accidentally forget a `break`." msgstr "" +"دستور`match` (به عنوان معادل Rust برای `switch`) فرو نمی‌پاشد (منظور fall-" +"through پذیر بودن ان است) ، بنابراین نمی‌توانید به طور تصادفی یک break را " +"فراموش کنید." #: src/why-rust/an-example-in-c.md:83 msgid "Buffer slices carry their size and don't rely on a NUL terminator." msgstr "" +"برش‌های بافر اندازه خود را حمل می کنند و به خاتمه دهنده `NUL` متکی نیستند." #: src/why-rust/an-example-in-c.md:84 msgid "" "Heap-allocated memory is freed via the `Drop` trait when the corresponding " "`Box` leaves the scope." msgstr "" +"حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می شود که " +"`Box` موردنظر اسکوپ مربوطه را ترک کند.‍" #: src/why-rust/an-example-in-c.md:85 msgid "" "Out-of-bounds accesses cause a panic or can be checked via the `get` method " "of a slice." msgstr "" +"دسترسی‌های خارج از محدوده باعث پانیک می شوند یا می توان آنها را از طریق متد " +"get یک برش (`slice`) بررسی کرد." #: src/why-rust/an-example-in-c.md:86 msgid "`match` mandates that all cases are handled." -msgstr "" +msgstr "دستور `match` الزام می کند که حالات بررسی شوند." #: src/why-rust/an-example-in-c.md:87 msgid "" @@ -2610,47 +2705,52 @@ msgid "" "thereby checked for success. Additionally, the compiler emits a warning if " "you miss to check the return value of a function marked with `#[must_use]`." msgstr "" +"توابع خطار پذیر در زبان Rust مقدار Result را برمی‌گردانند که باید باز شوند و " +"در نتیجه برای موفقیت بررسی شوند. علاوه بر این، اگر بررسی مقدار برگشتی تابعی " +"که با `#[must_use]` علامت گذاری شده است را فراموش کنید، " +"کامپایلر هشدار می دهد." #: src/why-rust/compile-time.md:3 msgid "Static memory management at compile time:" -msgstr "" +msgstr "مدیریت حافظه استاتیک در زمان کامپایل:" #: src/why-rust/compile-time.md:5 msgid "No uninitialized variables." -msgstr "" +msgstr "هیچ متغیر غیر ساخته شده (`uninitialized`) وجود ندارد." #: src/why-rust/compile-time.md:6 msgid "No memory leaks (_mostly_, see notes)." -msgstr "" +msgstr "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." #: src/why-rust/compile-time.md:7 msgid "No double-frees." -msgstr "" +msgstr "هیچ آزادسازی دوباره‌ای وجود ندارد." #: src/why-rust/compile-time.md:8 msgid "No use-after-free." -msgstr "" +msgstr "هیچ استفاده‌ای پس از آزادسازی وجود ندارد." #: src/why-rust/compile-time.md:9 msgid "No `NULL` pointers." -msgstr "" +msgstr "هیچ اشاره گر `NULL` وجود ندارد." #: src/why-rust/compile-time.md:10 msgid "No forgotten locked mutexes." -msgstr "" +msgstr "هیچ موتکس قفل شده فراموش شده وجود ندارد." #: src/why-rust/compile-time.md:11 msgid "No data races between threads." -msgstr "" +msgstr "هیچ مسابقه داده‌ای (`data races`) بین رشته‌ها وجود ندارد." #: src/why-rust/compile-time.md:12 msgid "No iterator invalidation." -msgstr "" +msgstr "هیچ باطل‌سازی تکرارکننده‌ای وجود ندارد." #: src/why-rust/compile-time.md:16 msgid "" "It is possible to produce memory leaks in (safe) Rust. Some examples are:" msgstr "" +"ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" #: src/why-rust/compile-time.md:19 msgid "" @@ -2658,6 +2758,10 @@ msgid "" "html#method.leak) to leak a pointer. A use of this could be to get runtime-" "initialized and runtime-sized static variables" msgstr "" +"می توانید از [`Box::leak`](https://doc.rust-lang.org/std/boxed/" +"struct.Box.html#method.leak) برای نشت دادن یک اشاره گر استفاده کنید." +"یک مورد استفاده از این کار می تواند برای بدست آوردن متغیرهای ایستا با " +"مقداردهی اولیه و اندازه در زمان اجرا باشد." #: src/why-rust/compile-time.md:21 msgid "" @@ -2665,36 +2769,45 @@ msgid "" "html) to make the compiler \"forget\" about a value (meaning the destructor " "is never run)." msgstr "" +"می توانید از [`std::mem::forget`](https://doc.rust-lang.org/" +"std/mem/fn.forget.html) استفاده کنید تا کامپایلر «مقدار» را فراموش " +"کند (به این معنا که مخرب هرگز اجرا نمی شود)." #: src/why-rust/compile-time.md:23 msgid "" "You can also accidentally create a [reference cycle](https://doc.rust-lang." "org/book/ch15-06-reference-cycles.html) with `Rc` or `Arc`." msgstr "" +"همچنین می توانید به طور تصادفی یک [چرخه ارجاع](https://doc.rust-lang.org/" +"book/ch15-06-reference-cycles.html) با `Rc` یا `Arc` ایجاد کنید." #: src/why-rust/compile-time.md:25 msgid "" "In fact, some will consider infinitely populating a collection a memory leak " "and Rust does not protect from those." msgstr "" +"در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه در " +"نظر می گیرند و Rust از آن محافظت نمی کند." #: src/why-rust/compile-time.md:28 msgid "" "For the purpose of this course, \"No memory leaks\" should be understood as " "\"Pretty much no _accidental_ memory leaks\"." msgstr "" +"برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «هیچ نشت حافظه تصادفی» " +"درنظر گرفته شود." #: src/why-rust/runtime.md:3 msgid "No undefined behavior at runtime:" -msgstr "" +msgstr "هیچ رفتار تعریف نشده ای در زمان اجرا:" #: src/why-rust/runtime.md:5 msgid "Array access is bounds checked." -msgstr "" +msgstr "دسترسی به آرایه محدوده بررسی می شود." #: src/why-rust/runtime.md:6 msgid "Integer overflow is defined (panic or wrap-around)." -msgstr "" +msgstr "سرریز عدد صحیح تعریف شده است (پانیک یا `wrap-around`)." #: src/why-rust/runtime.md:12 msgid "" @@ -2705,6 +2818,12 @@ msgid "" "panics in debug mode (`cargo build`) and wrap-around in release mode (`cargo " "build --release`)." msgstr "" +"سرریز عدد صحیح از طریق پرچم زمان کامپایل [`overflow-checks`](https://doc." +"rust-lang.org/rustc/codegen-options/index.html#overflow-checks) تعریف شده " +"است. گر فعال باشد، برنامه پانیک خواهد کرد (یک خرابی به صورت کنترل شده)، در " +"غیر این صورت wrap-around خواهید داشت.به طور پیش فرض، در حالت توسعه `debug " +"(cargo build)` شما پانیک خواهید داشت. و در حالت گرفتن خروجی برای پروداکشن " +"`release (cargo build --release)` حالت wrap-around خواهید داشت." #: src/why-rust/runtime.md:18 msgid "" @@ -2713,50 +2832,56 @@ msgid "" "call functions such as `slice::get_unchecked` which does not do bounds " "checking." msgstr "" +"بررسی محدوده نمی تواند با پرچم کامپایل غیرفعال شود. همچنین نمی توان آن را به " +"طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به شما " +"امکان می دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " +"محدوده را انجام نمی دهد. " #: src/why-rust/modern.md:3 msgid "Rust is built with all the experience gained in the last decades." msgstr "" +"زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده ساخته " +"شده است." #: src/why-rust/modern.md:5 msgid "Language Features" -msgstr "" +msgstr "ویژگی‌های زبان" #: src/why-rust/modern.md:7 msgid "Enums and pattern matching." -msgstr "" +msgstr "Enumها و تطابق الگوها." #: src/why-rust/modern.md:8 msgid "Generics." -msgstr "" +msgstr "جنریک‌ها." #: src/why-rust/modern.md:9 msgid "No overhead FFI." -msgstr "" +msgstr "FFI بدون سربار" #: src/why-rust/modern.md:10 msgid "Zero-cost abstractions." -msgstr "" +msgstr "انتزاع‌هایی با هزینه صفر" #: src/why-rust/modern.md:12 msgid "Tooling" -msgstr "" +msgstr "ابزارها" #: src/why-rust/modern.md:14 msgid "Great compiler errors." -msgstr "" +msgstr "خطاهای کامپایل عالیست." #: src/why-rust/modern.md:15 msgid "Built-in dependency manager." -msgstr "" +msgstr "مدیر وابستگی درون-ساختی" #: src/why-rust/modern.md:16 msgid "Built-in support for testing." -msgstr "" +msgstr "پشتیبانی درون-ساختی از تست نویسی" #: src/why-rust/modern.md:17 msgid "Excellent Language Server Protocol support." -msgstr "" +msgstr "پشتیبانی عالی از پروتکل‌های سرور." #: src/why-rust/modern.md:23 msgid "" @@ -2765,6 +2890,11 @@ msgid "" "writing a loop using `for` should result in roughly the same low level " "instructions as using the `.iter().fold()` construct." msgstr "" +"انتزاع‌هایی با هزینه صفر، مشابه C++، به این معنی است که " +"شما مجبور نیستید برای ساختارهای برنامه نویسی سطح بالاتر با حافظه یا CPU " +"«هزینه» ای پرداخت کنید. به عنوان مثال، نوشتن یک حلقه با استفاده از for باید " +"تقریباً به همان دستورالعمل‌های سطح پایین به عنوان استفاده از ساختار `iter().fold()` منجر شود." #: src/why-rust/modern.md:28 msgid "" @@ -2772,6 +2902,10 @@ msgid "" "known as 'sum types', which allow the type system to express things like " "`Option` and `Result`." msgstr "" +"ارزش ذکر را دارد که شمارشگرهای زبان Rust از «انواع داده جبری» هستند که " +"همچنین به عنوان «انواع جمع» شناخته می شوند، که به سیستم نوع اجازه می دهد " +"چیزهایی مانند `Option` و `Result` را بیان کند." #: src/why-rust/modern.md:32 msgid "" @@ -2780,6 +2914,10 @@ msgid "" "talkative than other compilers. It will often provide you with _actionable_ " "feedback, ready to copy-paste into your code." msgstr "" +"به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به " +"نادیده گرفتن خروجی طولانی کامپایلر عادت کرده اند. کامپایلر Rust به طور قابل " +"توجهی پرحرف تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را در " +"اختیار شما قرار می دهد که آماده کپی و پیست کردن در کد شما هستند." #: src/why-rust/modern.md:37 msgid "" @@ -2787,18 +2925,27 @@ msgid "" "and Go. Rust does not come with several things you might consider standard " "and essential:" msgstr "" +"کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go کوچک " +"است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری در نظر " +"بگیرید همراه نیست:" #: src/why-rust/modern.md:41 msgid "a random number generator, but see [rand](https://docs.rs/rand/)." msgstr "" +"یک ژنراتور عدد تصادفی، اما [کتابخانه `rand`](https://docs.rs/" +"rand/) را ببینید." #: src/why-rust/modern.md:42 msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." msgstr "" +"پشتیبانی از SSL یا TLS، اما میتوانید [کتابخانه `rusttls`]" +"(https://docs.rs/rustls/) را ببینید." #: src/why-rust/modern.md:43 msgid "support for JSON, but see [serde_json](https://docs.rs/serde_json/)." msgstr "" +"پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs.rs/" +"serde_json/) را ببینید." #: src/why-rust/modern.md:45 msgid "" @@ -2807,6 +2954,10 @@ msgid "" "Rust community is still working on finding the best solution --- and perhaps " "there isn't a single \"best solution\" for some of these things." msgstr "" +"منطق پشت این امر این است که نمیتوان عملکردی را از کتابخانه استانداردحذف کرد، " +"بنابراین باید بسیار مانا باشد. برای مثال‌های بالا، جامعه Rust هنوز در تلاش " +"است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این موارد، یک " +"«بهترین راه حل» وجود نداشته باشد. " #: src/why-rust/modern.md:50 msgid "" @@ -2814,6 +2965,9 @@ msgid "" "makes it trivial to download and compile third-party crates. A consequence " "of this is that the standard library can be smaller." msgstr "" +"زبان Rust همراه با یک مدیر بسته درون-ساختی به اسم Cargo ارائه می شود و این " +"امر دانلود و کامپایل کردن crates شخص ثالث را بسیار آسان می کند. یکی از " +"پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." #: src/why-rust/modern.md:54 msgid "" @@ -2821,71 +2975,82 @@ msgid "" "lib.rs/> help with this by letting you compare health metrics for crates to " "find a good and trusted one." msgstr "" +"یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای crates " +"به شما کمک می کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." #: src/why-rust/modern.md:58 msgid "" "[rust-analyzer](https://rust-analyzer.github.io/) is a well supported LSP " "implementation used in major IDEs and text editors." msgstr "" +"[rust-analyzer](https://rust-analyzer.github.io/): یک پیاده سازی LSP است که " +"در IDE‌ها و ویرایشگرهای متن اصلی استفاده می شود." #: src/basic-syntax.md:3 msgid "Much of the Rust syntax will be familiar to you from C, C++ or Java:" -msgstr "" +msgstr "بسیاری از دستور زبان Rust مشابه زبان‌های C، C++ یا Java خواهد بود:" #: src/basic-syntax.md:5 msgid "Blocks and scopes are delimited by curly braces." -msgstr "" +msgstr "بلاک‌ها و اسکوپ‌ها با پرانتزهای باز و بسته مشخص می شوند." #: src/basic-syntax.md:6 msgid "" "Line comments are started with `//`, block comments are delimited by `/* ... " "*/`." msgstr "" +"کامنت‌های تک خطی با ‍`//` شروع می شوند و کامنت‌های چند خطی با `/* ... */` مشخص " +"می شوند." #: src/basic-syntax.md:8 msgid "Keywords like `if` and `while` work the same." -msgstr "" +msgstr "کلمات کلیدی مانند `if `و `while` به همان صورت عمل می کنند." #: src/basic-syntax.md:9 msgid "Variable assignment is done with `=`, comparison is done with `==`." -msgstr "" +msgstr "انتساب متغیر با `=` انجام می شود، مقایسه با `==` انجام می شود." #: src/basic-syntax/scalar-types.md:3 src/basic-syntax/compound-types.md:3 #: src/exercises/day-3/safe-ffi-wrapper.md:16 msgid "Types" -msgstr "" +msgstr "انواع" #: src/basic-syntax/scalar-types.md:3 src/basic-syntax/compound-types.md:3 msgid "Literals" -msgstr "" +msgstr "مقادیر ثابت" #: src/basic-syntax/scalar-types.md:5 msgid "Signed integers" -msgstr "" +msgstr "اعداد علامت‌دار" #: src/basic-syntax/scalar-types.md:5 msgid "`i8`, `i16`, `i32`, `i64`, `i128`, `isize`" -msgstr "" +msgstr "`i8`, `i16`, `i32`, `i64`, `i128`, `isize`" #: src/basic-syntax/scalar-types.md:5 msgid "`-10`, `0`, `1_000`, `123_i64`" msgstr "" +"-10, 0, 1_000, 123_i64" #: src/basic-syntax/scalar-types.md:6 msgid "Unsigned integers" -msgstr "" +msgstr "اعداد مثبت" #: src/basic-syntax/scalar-types.md:6 msgid "`u8`, `u16`, `u32`, `u64`, `u128`, `usize`" -msgstr "" +msgstr "`u8`, `u16`, `u32`, `u64`, `u128`, `usize`" #: src/basic-syntax/scalar-types.md:6 msgid "`0`, `123`, `10_u16`" msgstr "" +"0, 123, 10_u16" #: src/basic-syntax/scalar-types.md:7 msgid "Floating point numbers" -msgstr "" +msgstr "اعداد با ممیز شناور" #: src/basic-syntax/scalar-types.md:7 msgid "`f32`, `f64`" @@ -2894,22 +3059,26 @@ msgstr "" #: src/basic-syntax/scalar-types.md:7 msgid "`3.14`, `-10.0e20`, `2_f32`" msgstr "" +"3.14, -10.0e20, 2_f32" #: src/basic-syntax/scalar-types.md:8 msgid "Strings" -msgstr "" +msgstr "رشته‌ها" #: src/basic-syntax/scalar-types.md:8 msgid "`&str`" -msgstr "" +msgstr "&str" #: src/basic-syntax/scalar-types.md:8 msgid "`\"foo\"`, `\"two\\nlines\"`" msgstr "" +"\"foo\", \"two\n" +"lines\"" #: src/basic-syntax/scalar-types.md:9 msgid "Unicode scalar values" -msgstr "" +msgstr "مقادیر عددی یونی‌کد" #: src/basic-syntax/scalar-types.md:9 msgid "`char`" @@ -2921,7 +3090,7 @@ msgstr "" #: src/basic-syntax/scalar-types.md:10 msgid "Booleans" -msgstr "" +msgstr "بولین‌ها" #: src/basic-syntax/scalar-types.md:10 msgid "`bool`" @@ -2933,27 +3102,27 @@ msgstr "" #: src/basic-syntax/scalar-types.md:12 msgid "The types have widths as follows:" -msgstr "" +msgstr "مقادیر حافظه انواع به شرح زیر است:" #: src/basic-syntax/scalar-types.md:14 msgid "`iN`, `uN`, and `fN` are _N_ bits wide," -msgstr "" +msgstr "`iN`, `uN`و `fN` به اندازه _N_ حافظه اشغال می‌کنند.," #: src/basic-syntax/scalar-types.md:15 msgid "`isize` and `usize` are the width of a pointer," -msgstr "" +msgstr "`isize` و `usize` به اندازه یک اشاره‌گر حافظه اشغال می‌کنند," #: src/basic-syntax/scalar-types.md:16 msgid "`char` is 32 bits wide," -msgstr "" +msgstr "`char` به اندازه 32 بیت حافظه اشغال می‌کنند.," #: src/basic-syntax/scalar-types.md:17 msgid "`bool` is 8 bits wide." -msgstr "" +msgstr "`bool` به اندازه 8 بیت حافظه اشغال می‌کنند." #: src/basic-syntax/scalar-types.md:21 msgid "There are a few syntaxes which are not shown above:" -msgstr "" +msgstr "موارد اندکی وجود دارند که در بالا نشان داده نشده است:" #: src/basic-syntax/scalar-types.md:23 msgid "" @@ -2961,10 +3130,16 @@ msgid "" "`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " "amount of `#` on either side of the quotes:" msgstr "" +"رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" " +"== \"\\\\n\"`.شما می توانید با استفاده از تعداد برابر `#` در دو طرف نقل " +"قول‌ها، نقل قول‌های دوگانه را جاسازی کنید:" #: src/basic-syntax/scalar-types.md:35 msgid "Byte strings allow you to create a `&[u8]` value directly:" msgstr "" +"رشته‌های بایت به شما امکان می دهند مستقیماً یک مقدار `&[u8]` ایجاد کنید:" #: src/basic-syntax/scalar-types.md:45 msgid "" @@ -2972,42 +3147,53 @@ msgid "" "`1_000` can be written as `1000` (or `10_00`), and `123_i64` can be written " "as `123i64`." msgstr "" +"می توان همه خطوط زیرین `_` را در اعداد حذف کرد، آنها فقط برای خوانایی " +"هستند. «`1_000` می تواند به صورت `1000` (یا `10_00`) نوشته شود و `123_i64` می تواند به صورت `123i64` " +"نوشته شود.»" #: src/basic-syntax/compound-types.md:5 msgid "Arrays" -msgstr "" +msgstr "آرایه‌ها" #: src/basic-syntax/compound-types.md:5 msgid "`[T; N]`" -msgstr "" +msgstr "[T; N]" #: src/basic-syntax/compound-types.md:5 msgid "`[20, 30, 40]`, `[0; 3]`" msgstr "" +"[20, 30, 40], [0; 3]" #: src/basic-syntax/compound-types.md:6 msgid "Tuples" -msgstr "" +msgstr "تاپل‌ها" #: src/basic-syntax/compound-types.md:6 msgid "`()`, `(T,)`, `(T1, T2)`, ..." msgstr "" +"(), (T,), " +"(T1, T2), …" #: src/basic-syntax/compound-types.md:6 msgid "`()`, `('x',)`, `('x', 1.2)`, ..." msgstr "" +"(), ('x',), " +"('x', 1.2), …" #: src/basic-syntax/compound-types.md:8 msgid "Array assignment and access:" -msgstr "" +msgstr "انتساب و دسترسی به آرایه:" #: src/basic-syntax/compound-types.md:19 msgid "Tuple assignment and access:" -msgstr "" +msgstr "انتساب و دسترسی به تاپل:" #: src/basic-syntax/compound-types.md:34 msgid "Arrays:" -msgstr "" +msgstr "آرایه‌ها:" #: src/basic-syntax/compound-types.md:36 msgid "" @@ -3016,10 +3202,16 @@ msgid "" "its type_, which means that `[u8; 3]` and `[u8; 4]` are considered two " "different types." msgstr "" +"یک مقدار از نوع آرایه `[T; N]` دارای `N` (یک ثابت زمان کامپایل) عنصر از نوع یکسان `T` " +"است. توجه داشته باشید که طول آرایه بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در " +"نظر گرفته می شوند." #: src/basic-syntax/compound-types.md:40 msgid "We can use literals to assign values to arrays." msgstr "" +"ما می توانیم از مقادیر ثابت برای انتساب مقادیر به آرایه‌ها استفاده کنیم." #: src/basic-syntax/compound-types.md:42 msgid "" @@ -3029,30 +3221,40 @@ msgid "" "only implement the debug output. This means that we must use debug output " "here." msgstr "" +"ماکرو `println!` با پارامتر فرمت `?` نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش " +"فرض را می دهد، `{:?}` خروجی دیباگ را می دهد. انواع‌ای " +"مانند اعداد صحیح و رشته‌ها خروجی پیش فرض را پیاده سازی می کنند، اما آرایه‌ها " +"فقط خروجی دیباگ را پیاده سازی می کنند. این بدان معناست که ما باید در اینجا " +"از خروجی دیباگ استفاده کنیم." #: src/basic-syntax/compound-types.md:47 msgid "" "Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " "easier to read." msgstr "" +"اضافه کردن `#`، مانند `{a:#?}`، یک " +"فرمت «چاپ زیبا» را فراخوانی می کند که می تواند خواندن آن را آسان تر کند." #: src/basic-syntax/compound-types.md:49 msgid "Tuples:" -msgstr "" +msgstr "تاپل‌ها" #: src/basic-syntax/compound-types.md:51 msgid "Like arrays, tuples have a fixed length." -msgstr "" +msgstr "مانند آرایه‌ها، تاپل‌ها نیز دارای طول ثابت هستند." #: src/basic-syntax/compound-types.md:53 msgid "Tuples group together values of different types into a compound type." -msgstr "" +msgstr "تاپل‌ها مقادیر انواع مختلف را در یک نوع ترکیبی کنارهم قرار می‌دهند." #: src/basic-syntax/compound-types.md:55 msgid "" "Fields of a tuple can be accessed by the period and the index of the value, " "e.g. `t.0`, `t.1`." msgstr "" +"می توان به فیلدهای یک تاپل با استفاده از نقطه و شماره ایندکس مقدار، مانند " +"`t.0`، `t.1` دسترسی پیدا کرد." #: src/basic-syntax/compound-types.md:57 msgid "" @@ -3061,12 +3263,19 @@ msgid "" "value are expressed as `()`. It is used to indicate, for example, that a " "function or expression has no return value, as we'll see in a future slide. " msgstr "" +"تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته می " +"شود. این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم " +"مقدار آن به صورت `()` بیان می شوند.رای مثال برای نشان " +"دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می شود، همانطور " +"که در اسلاید بعدی خواهیم دید. " #: src/basic-syntax/compound-types.md:61 msgid "" "You can think of it as `void` that can be familiar to you from other " "programming languages." msgstr "" +"می‌توانید آن را به عنوان `void` در نظر بگیرید که ممکن است از سایر زبان‌های " +"برنامه‌نویسی برایتان آشنا باشد." #: src/basic-syntax/references.md:3 msgid "Like C++, Rust has references:" @@ -5097,7 +5306,7 @@ msgstr "Ownership: حرکت semantics،copying و cloning, borrowing و lifetim #: src/welcome-day-2.md:10 #, fuzzy msgid "Structs and methods." -msgstr "رشته ها و تکرار کننده‌ها (Strings and Iterators)" +msgstr "رشته‌ها و تکرار کننده‌ها (Strings and Iterators)" #: src/welcome-day-2.md:12 msgid "" @@ -9474,7 +9683,7 @@ msgstr "" #: src/error-handling/converting-error-types.md:18 msgid "" "The `From::from` call here means we attempt to convert the error type to the " -"type returned by the function:" +"type returned by the function." msgstr "" #: src/error-handling/converting-error-types-example.md:3 From aaeae29e926b0a1e591676bc468e9fbb466ebd18 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Tue, 31 Oct 2023 16:59:43 +0330 Subject: [PATCH 02/23] revert back to `https://github.com/google/comprehensive-rust/blob/main/po/fa.po#L9686` --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 49f0aa27bf43..8fc198cb22be 100644 --- a/po/fa.po +++ b/po/fa.po @@ -9683,7 +9683,7 @@ msgstr "" #: src/error-handling/converting-error-types.md:18 msgid "" "The `From::from` call here means we attempt to convert the error type to the " -"type returned by the function." +"type returned by the function:" msgstr "" #: src/error-handling/converting-error-types-example.md:3 From 081504f6aab19296dfceff20b844413dcb3fe37c Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Tue, 31 Oct 2023 21:32:43 +0330 Subject: [PATCH 03/23] small adjustments --- po/fa.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/fa.po b/po/fa.po index 8fc198cb22be..83562dcfa4a0 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1168,7 +1168,7 @@ msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. Rust یک زبان استاتیک تایپ ." "است \n" "و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم " -"تا رویکرد‌های Rust را بهتر توضیح دهیم یا در در حالت مقایسه با آن قرار دهیم." +"تا رویکرد‌های Rust را بهتر توضیح دهیم یا در حالت مقایسه با آن قرار دهیم." #: src/index.md:52 msgid "" @@ -2210,7 +2210,7 @@ msgstr "نمایشگر‌های هوشمند" #: src/welcome-day-1/what-is-rust.md:14 msgid "mobile phones," -msgstr "تلفن همراه" +msgstr "تلفن‌های همراه" #: src/welcome-day-1/what-is-rust.md:15 msgid "desktops," @@ -2299,7 +2299,7 @@ msgid "" "familiar." msgstr "" "این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز " -"آینده خیلی از این کدها خواهند دید، بنابراین با چیز آشنا شروع می کنیم.." +"آینده خیلی از این کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." #: src/hello-world.md:27 msgid "" From d47a868bfc48367dd64e7e87e7ee9b2978d357ab Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Tue, 31 Oct 2023 23:23:25 +0330 Subject: [PATCH 04/23] fix typo and small adjustments --- po/fa.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/po/fa.po b/po/fa.po index 83562dcfa4a0..5c426c979411 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2068,7 +2068,7 @@ msgid "" "Basic Rust syntax: variables, scalar and compound types, enums, structs, " "references, functions, and methods." msgstr "" -" سینتکس‌های مقدماتی: متغییرها, تایپ‌های عددی و تایپ‌های مرکب, enums, structs, " +" سینتکس‌های مقدماتی: متغیرها, تایپ‌های عددی و تایپ‌های مرکب, enums, structs, " "مراجع, توابع, و متدها." #: src/welcome-day-1.md:9 @@ -2137,7 +2137,7 @@ msgid "" msgstr "" "ایده برای روز اول این است که فقط به اندازه کافی از Rust را نشان دهیم تا " "بتوانیم در مورد بررسی کننده قرض `borrow checker` معروف صحبت کنیم.نحوه مدیریت " -"حافظه توسط Rust یک ویژگی مهم استو باید آن را بلافاصله به دانشجویان نشان دهیم." +"حافظه توسط Rust یک ویژگی مهم است و باید آن را بلافاصله به دانشجویان نشان دهیم." #: src/welcome-day-1.md:33 msgid "" @@ -2371,7 +2371,7 @@ msgid "" msgstr "" "```rust,editable\n" "fn main() { // نقطه ورودی برنامه\n" -" let mut x: i32 = 6; //انتساب متغییر قابل تغییر\n" +" let mut x: i32 = 6; //انتساب متغیر قابل تغییر\n" " print!(\"{x}\"); // ماکرویی برای پرینت به مانند printf\n" " while x != 1 { // هیچ پرانتزی دور دستور نیست\n" " if x % 2 == 0 { // دستور Math به مانند بقیه زبان ها \n" @@ -2740,11 +2740,11 @@ msgstr "هیچ موتکس قفل شده فراموش شده وجود ندارد. #: src/why-rust/compile-time.md:11 msgid "No data races between threads." -msgstr "هیچ مسابقه داده‌ای (`data races`) بین رشته‌ها وجود ندارد." +msgstr " هیچ وضعیت رقابتی (`data races`) بین رشته‌ها وجود ندارد." #: src/why-rust/compile-time.md:12 msgid "No iterator invalidation." -msgstr "هیچ باطل‌سازی تکرارکننده‌ای وجود ندارد." +msgstr "عدم اعتبار تکرارکننده." #: src/why-rust/compile-time.md:16 msgid "" @@ -2820,7 +2820,7 @@ msgid "" msgstr "" "سرریز عدد صحیح از طریق پرچم زمان کامپایل [`overflow-checks`](https://doc." "rust-lang.org/rustc/codegen-options/index.html#overflow-checks) تعریف شده " -"است. گر فعال باشد، برنامه پانیک خواهد کرد (یک خرابی به صورت کنترل شده)، در " +"است. اگر فعال باشد، برنامه پانیک خواهد کرد (یک خرابی به صورت کنترل شده)، در " "غیر این صورت wrap-around خواهید داشت.به طور پیش فرض، در حالت توسعه `debug " "(cargo build)` شما پانیک خواهید داشت. و در حالت گرفتن خروجی برای پروداکشن " "`release (cargo build --release)` حالت wrap-around خواهید داشت." From 78765cf48ea3b6dfe5702e0071d02871f4ad5551 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Tue, 31 Oct 2023 23:26:29 +0330 Subject: [PATCH 05/23] reformated --- po/fa.po | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 5c426c979411..3a2ca12d93ce 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2137,7 +2137,8 @@ msgid "" msgstr "" "ایده برای روز اول این است که فقط به اندازه کافی از Rust را نشان دهیم تا " "بتوانیم در مورد بررسی کننده قرض `borrow checker` معروف صحبت کنیم.نحوه مدیریت " -"حافظه توسط Rust یک ویژگی مهم است و باید آن را بلافاصله به دانشجویان نشان دهیم." +"حافظه توسط Rust یک ویژگی مهم است و باید آن را بلافاصله به دانشجویان نشان " +"دهیم." #: src/welcome-day-1.md:33 msgid "" From 4bfe14bdc0d8950079c2e7b1fa44b7ecbc670658 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Wed, 1 Nov 2023 09:58:28 +0330 Subject: [PATCH 06/23] Update po/fa.po Co-authored-by: Kaveh --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 3a2ca12d93ce..18614eeee621 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2862,7 +2862,7 @@ msgstr "FFI بدون سربار" #: src/why-rust/modern.md:10 msgid "Zero-cost abstractions." -msgstr "انتزاع‌هایی با هزینه صفر" +msgstr "انتزاع‌هایی بدون هزینه" #: src/why-rust/modern.md:12 msgid "Tooling" From c62a22a3266704d5800c41e3b658fa758bb940a2 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Wed, 1 Nov 2023 10:05:41 +0330 Subject: [PATCH 07/23] Update po/fa.po Co-authored-by: Kaveh --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 18614eeee621..8c22a8d57553 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2737,7 +2737,7 @@ msgstr "هیچ اشاره گر `NULL` وجود ندارد." #: src/why-rust/compile-time.md:10 msgid "No forgotten locked mutexes." -msgstr "هیچ موتکس قفل شده فراموش شده وجود ندارد." +msgstr "هیچ موتکس قفل شدهِ فراموش شده‌ای وجود ندارد." #: src/why-rust/compile-time.md:11 msgid "No data races between threads." From db9f25bd0674b5cb468da001d1dd2e94f33ced5f Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Wed, 1 Nov 2023 10:08:55 +0330 Subject: [PATCH 08/23] Updated and reformated --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 8c22a8d57553..3ca333fda425 100644 --- a/po/fa.po +++ b/po/fa.po @@ -3103,7 +3103,7 @@ msgstr "" #: src/basic-syntax/scalar-types.md:12 msgid "The types have widths as follows:" -msgstr "مقادیر حافظه انواع به شرح زیر است:" +msgstr "اندازه تایپ‌ها به شرح زیر است:" #: src/basic-syntax/scalar-types.md:14 msgid "`iN`, `uN`, and `fN` are _N_ bits wide," From a507d1e1277e7ca1c71071dda8498400d315f982 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Sat, 4 Nov 2023 12:18:47 +0330 Subject: [PATCH 09/23] Apply suggestions from code review Co-authored-by: Kaveh --- po/fa.po | 202 +++++++++++++++++++++++++++---------------------------- 1 file changed, 101 insertions(+), 101 deletions(-) diff --git a/po/fa.po b/po/fa.po index 3ca333fda425..7d3e99be4294 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1369,7 +1369,7 @@ msgid "" msgstr "" "در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد " "استفاده از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت " -"تعاملبا C، C++ و جاوا می شود." +"تعامل با C، C++ و جاوا می‌شود." #: src/running-the-course/course-structure.md:25 msgid "" @@ -2076,12 +2076,12 @@ msgid "" "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, and " "`continue`." msgstr "" -"سازوکارهای جریان کنترل: `if`, `if let`, `while`, `while let`, `break` و " +"سازوکارهای کنترل جریان: `if`, `if let`, `while`, `while let`, `break` و " "`continue`. " #: src/welcome-day-1.md:12 msgid "Pattern matching: destructuring enums, structs, and arrays." -msgstr "تطابق الگو: تجزیه و تحلیل enums, structsو arrays." +msgstr "تطابق الگو: تجزیه و تحلیل enums, structs و آرایه‌ها." #: src/welcome-day-1.md:16 msgid "Please remind the students that:" @@ -2151,7 +2151,7 @@ msgstr "" #: src/welcome-day-1.md:36 msgid "Morning: 9:00 to 12:00," -msgstr "صبح : ۹:۰۰ تا ۱۲:۰۰" +msgstr "صبح: ۹:۰۰ تا ۱۲:۰۰" #: src/welcome-day-1.md:37 msgid "Afternoon: 13:00 to 16:00." @@ -2162,8 +2162,8 @@ msgid "" "You can of course adjust this as necessary. Please make sure to include " "breaks, we recommend a break every hour!" msgstr "" -"البته می توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " -"را نیز درنظر بگیرید، ما توصیه می کنیم هر ساعت یک استراحت داشته باشید!" +"البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " +"را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" #: src/welcome-day-1/what-is-rust.md:3 msgid "" @@ -2199,7 +2199,7 @@ msgstr "Linux, Mac, Windows, ..." #: src/welcome-day-1/what-is-rust.md:11 msgid "Rust is used for a wide range of devices:" -msgstr ":راست برای طیف گسترده ای از دستگاه‌ها استفاده می شود" +msgstr ":راست برای طیف گسترده‌ای از دستگاه‌ها استفاده می‌شود" #: src/welcome-day-1/what-is-rust.md:12 msgid "firmware and boot loaders," @@ -2215,7 +2215,7 @@ msgstr "تلفن‌های همراه" #: src/welcome-day-1/what-is-rust.md:15 msgid "desktops," -msgstr "دسکتاپ" +msgstr "رایانه‌های رومیزی" #: src/welcome-day-1/what-is-rust.md:16 msgid "servers." @@ -2223,7 +2223,7 @@ msgstr "سرورها" #: src/welcome-day-1/what-is-rust.md:21 msgid "Rust fits in the same area as C++:" -msgstr "Rust در همان حوزه C++ قرار می گیرد:" +msgstr "Rust در همان حوزه C++ قرار می‌گیرد:" #: src/welcome-day-1/what-is-rust.md:23 msgid "High flexibility." @@ -2265,7 +2265,7 @@ msgstr "" #: src/hello-world.md:12 msgid "What you see:" -msgstr "شما چه چیزی‌ رو می‌بینید؟" +msgstr "آنچه شما می‌بینید:" #: src/hello-world.md:14 msgid "Functions are introduced with `fn`." @@ -2284,13 +2284,13 @@ msgstr "تابع `main` نقطه ورود برنامه است." #: src/hello-world.md:17 msgid "Rust has hygienic macros, `println!` is an example of this." msgstr "" -"زبان Rust دارای ماکروهای ترتمیز است، `println!` یک " +"زبان Rust دارای ماکروهای hygienic است، `println!` یک " "نمونه از این است." #: src/hello-world.md:18 msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." msgstr "" -"رشته‌های Rust با انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر Unicode " +"رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد " "باشند." #: src/hello-world.md:22 @@ -2308,12 +2308,12 @@ msgid "" "imperative and it doesn't try to reinvent things unless absolutely necessary." msgstr "" "زبان Rust, زبان بسیار شبیه به سایر زبان‌های خانواده C/C++/Java است.یک زبان امری است (imperative) و سعی نمی کند چیزی را مگر اینکه " +"span>/Java است.یک زبان امری است (imperative) و سعی نمی‌کند چیزی را مگر اینکه " "کاملاً ضروری باشد، دوباره اختراع کند." #: src/hello-world.md:31 msgid "Rust is modern with full support for things like Unicode." -msgstr "زبان Rust, یک زبان مدرن با پشتیبانی کامل از چیزهایی مانند Unicode است." +msgstr "زبان Rust, یک زبان مدرن با پشتیبانی کامل از چیزهایی مانند یونیکد است." #: src/hello-world.md:33 msgid "" @@ -2332,7 +2332,7 @@ msgid "" "html)." msgstr "" "«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی " -"شناسه‌ها را از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند.ماکروهای Rust در " +"شناسه‌ها را از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در " "واقع فقط [تا حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/" "minutiae/hygiene.html هستند." @@ -2344,8 +2344,8 @@ msgid "" "concepts](https://doc.rust-lang.org/book/ch13-00-functional-features.html)." msgstr "" "زبان Rust, یک زبان چند پارادایمی است. به عنوان مثال، دارای ویژگی‌های قدرتمند " -"[برنامه نویسی شی گرا](https://doc.rust-lang.org/book/ch17-00-oop.html) است و " -"در حالی که یک زبان تابعی(`functional‍`) نیست، شامل طیف وسیعی از [مفاهیم تابعی]" +"[برنامه نویسی شی‌گرا](https://doc.rust-lang.org/book/ch17-00-oop.html) است و " +"در حالی که یک زبان فانکشنال(`functional‍`) نیست، شامل طیف وسیعی از [مفاهیم فانکشنال]" "(https://doc.rust-lang.org/book/ch13-00-functional-features.html) است." #: src/hello-world/small-example.md:3 @@ -2373,9 +2373,9 @@ msgstr "" "```rust,editable\n" "fn main() { // نقطه ورودی برنامه\n" " let mut x: i32 = 6; //انتساب متغیر قابل تغییر\n" -" print!(\"{x}\"); // ماکرویی برای پرینت به مانند printf\n" -" while x != 1 { // هیچ پرانتزی دور دستور نیست\n" -" if x % 2 == 0 { // دستور Math به مانند بقیه زبان ها \n" +" print!(\"{x}\"); // ماکرویی برای چاپ‌کردن به مانند printf\n" +" while x != 1 { // هیچ پرانتزی اطراف دستور نیست\n" +" if x % 2 == 0 { // محاسبات مانند بقیه زبان ها \n" " x = x / 2;\n" " } else {\n" " x = 3 * x + 1;\n" @@ -2423,7 +2423,7 @@ msgid "" "Show how you need to use `{}` as a placeholder if you want to print an " "expression which is more complex than just a single variable." msgstr "" -"نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده تر از یک متغیر واحد " +"نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر واحد " "است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." #: src/hello-world/small-example.md:40 @@ -2433,7 +2433,7 @@ msgid "" "that the students become familiar with searching in the standard library." msgstr "" "کتابخانه استاندارد را به دانشجویان نشان دهید، به آنها نشان دهید که چگونه " -"`std::fmt` را که قوانین زبان-کوچک قالب بندی را دارد جستجو کنند. مهم است که " +"`std::fmt` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که " "دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." #: src/hello-world/small-example.md:44 @@ -2442,7 +2442,7 @@ msgid "" "documentation" msgstr "" "در یک خط‌‌‌‌فرمان (`shell`) دستور `rustup doc std::fmt` را بزنید تا مستندات محلی " -"‍`std::fmt` را توی مرورگری کند." +"‍`std::fmt` را توی مرورگر باز کند." #: src/why-rust.md:3 msgid "Some unique selling points of Rust:" @@ -2476,10 +2476,10 @@ msgid "" "constructs like pattern matching and built-in dependency management." msgstr "" "تجربه با C یا C++ : زبان Rust با استفاده از بررسی کننده " -"وام گیری (اشاره به مبحث قرض گرفتن یا `borrow`) ، یک سری کامل از _خطاهای " -"زمان اجرا_ را از بین می برد.t عملکردی مانند C و C++ را " -"دارید اما مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن " -"با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می کنید." +"قرض‌گیری (اشاره به مبحث قرض گرفتن یا `borrow`) ، یک سری کامل از _خطاهای " +"زمان اجرا_ را از بین می‌برد .t عملکردی مانند C و C++ را " +"دارید اما مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن " +"با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." #: src/why-rust.md:19 msgid "" @@ -2489,8 +2489,8 @@ msgid "" "collector) as well as access to low-level hardware (should you need it)" msgstr "" "تجربه با Java، Go، Python، JavaScript...: شما همان ایمنی حافظه را مانند آن " -"زبان‌ها دریافت می‌کنید، به علاوه یک احساس زبان سطح بالا مشابه. علاوه بر این، " -"شما عملکرد سریع و قابل پیش‌بینی مانند C و C++ (بدون " +"زبان‌ها دریافت می‌کنید، به علاوه یک احساس زبان سطح بالا مشابه. علاوه بر این، " +"شما عملکرد سریع و قابل پیش‌بینی مانند C و C++ (بدون " "جمع‌آوری زباله) و همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت " "می‌کنید." @@ -2647,8 +2647,8 @@ msgid "" "_How is Rust any better here?_ \n" "Safe Rust makes all of these bugs impossible:" msgstr "" -"_چطوری زبان راست در اینجا بهتر عمل میکند?_ \n" -"راست ایمن تمام این باگ‌ها را غیرممکن می کند:" +"_چطوری زبان راست در اینجا بهتر عمل می‌کند?_ \n" +"راست ایمن تمام این باگ‌ها را غیرممکن می‌کند:" #: src/why-rust/an-example-in-c.md:78 msgid "Assignments inside an `if` clause are not supported." @@ -2660,7 +2660,7 @@ msgstr "قالب‌بندی رشته‌ها در زمان کامپایل برر #: src/why-rust/an-example-in-c.md:80 msgid "Resources are freed at the end of scope via the `Drop` trait." -msgstr "منابع در پایان دامنه از طریق ویژگی `Drop` آزاد می‌شوند." +msgstr "منابع در پایان اسکوپ از طریق ویژگی `Drop` آزاد می‌شوند." #: src/why-rust/an-example-in-c.md:81 msgid "All `if` clauses require braces." @@ -2678,27 +2678,27 @@ msgstr "" #: src/why-rust/an-example-in-c.md:83 msgid "Buffer slices carry their size and don't rely on a NUL terminator." msgstr "" -"برش‌های بافر اندازه خود را حمل می کنند و به خاتمه دهنده `NUL` متکی نیستند." +"برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." #: src/why-rust/an-example-in-c.md:84 msgid "" "Heap-allocated memory is freed via the `Drop` trait when the corresponding " "`Box` leaves the scope." msgstr "" -"حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می شود که " -"`Box` موردنظر اسکوپ مربوطه را ترک کند.‍" +"حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که " +"`Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" #: src/why-rust/an-example-in-c.md:85 msgid "" "Out-of-bounds accesses cause a panic or can be checked via the `get` method " "of a slice." msgstr "" -"دسترسی‌های خارج از محدوده باعث پانیک می شوند یا می توان آنها را از طریق متد " -"get یک برش (`slice`) بررسی کرد." +"دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد " +"get یک برش (`slice`) بررسی کرد." #: src/why-rust/an-example-in-c.md:86 msgid "`match` mandates that all cases are handled." -msgstr "دستور `match` الزام می کند که حالات بررسی شوند." +msgstr "دستور `match` الزام می‌کند که حالات بررسی شوند." #: src/why-rust/an-example-in-c.md:87 msgid "" @@ -2706,18 +2706,18 @@ msgid "" "thereby checked for success. Additionally, the compiler emits a warning if " "you miss to check the return value of a function marked with `#[must_use]`." msgstr "" -"توابع خطار پذیر در زبان Rust مقدار Result را برمی‌گردانند که باید باز شوند و " +"توابع خطا پذیر در زبان Rust مقدار Result را برمی‌گردانند که باید باز شوند و " "در نتیجه برای موفقیت بررسی شوند. علاوه بر این، اگر بررسی مقدار برگشتی تابعی " "که با `#[must_use]` علامت گذاری شده است را فراموش کنید، " -"کامپایلر هشدار می دهد." +"کامپایلر هشدار می‌دهد." #: src/why-rust/compile-time.md:3 msgid "Static memory management at compile time:" -msgstr "مدیریت حافظه استاتیک در زمان کامپایل:" +msgstr "مدیریت حافظه ایستا در زمان کامپایل:" #: src/why-rust/compile-time.md:5 msgid "No uninitialized variables." -msgstr "هیچ متغیر غیر ساخته شده (`uninitialized`) وجود ندارد." +msgstr "هیچ متغیر مقدار‌دهی نشده‌ای (`uninitialized`) وجود ندارد." #: src/why-rust/compile-time.md:6 msgid "No memory leaks (_mostly_, see notes)." @@ -2733,7 +2733,7 @@ msgstr "هیچ استفاده‌ای پس از آزادسازی وجود ندا #: src/why-rust/compile-time.md:9 msgid "No `NULL` pointers." -msgstr "هیچ اشاره گر `NULL` وجود ندارد." +msgstr "هیچ اشاره‌گر `NULL` وجود ندارد." #: src/why-rust/compile-time.md:10 msgid "No forgotten locked mutexes." @@ -2745,7 +2745,7 @@ msgstr " هیچ وضعیت رقابتی (`data races`) بین رشته‌ها و #: src/why-rust/compile-time.md:12 msgid "No iterator invalidation." -msgstr "عدم اعتبار تکرارکننده." +msgstr "تکرارکننده‌ها (`iterators`) هیچگاه نامعتبر نمی‌شوند.." #: src/why-rust/compile-time.md:16 msgid "" @@ -2760,8 +2760,8 @@ msgid "" "initialized and runtime-sized static variables" msgstr "" "می توانید از [`Box::leak`](https://doc.rust-lang.org/std/boxed/" -"struct.Box.html#method.leak) برای نشت دادن یک اشاره گر استفاده کنید." -"یک مورد استفاده از این کار می تواند برای بدست آوردن متغیرهای ایستا با " +"struct.Box.html#method.leak) برای نشت دادن یک اشاره‌گر استفاده کنید." +"یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای ایستا با " "مقداردهی اولیه و اندازه در زمان اجرا باشد." #: src/why-rust/compile-time.md:21 @@ -2772,14 +2772,14 @@ msgid "" msgstr "" "می توانید از [`std::mem::forget`](https://doc.rust-lang.org/" "std/mem/fn.forget.html) استفاده کنید تا کامپایلر «مقدار» را فراموش " -"کند (به این معنا که مخرب هرگز اجرا نمی شود)." +"کند (به این معنا که تابع مخرب (`destructor`) هرگز اجرا نمی‌شود)." #: src/why-rust/compile-time.md:23 msgid "" "You can also accidentally create a [reference cycle](https://doc.rust-lang." "org/book/ch15-06-reference-cycles.html) with `Rc` or `Arc`." msgstr "" -"همچنین می توانید به طور تصادفی یک [چرخه ارجاع](https://doc.rust-lang.org/" +"همچنین می‌توانید به طور تصادفی یک [چرخه ارجاع](https://doc.rust-lang.org/" "book/ch15-06-reference-cycles.html) با `Rc` یا `Arc` ایجاد کنید." #: src/why-rust/compile-time.md:25 @@ -2788,23 +2788,23 @@ msgid "" "and Rust does not protect from those." msgstr "" "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه در " -"نظر می گیرند و Rust از آن محافظت نمی کند." +"نظر می‌گیرند و Rust از آن محافظت نمی‌کند." #: src/why-rust/compile-time.md:28 msgid "" "For the purpose of this course, \"No memory leaks\" should be understood as " "\"Pretty much no _accidental_ memory leaks\"." msgstr "" -"برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «هیچ نشت حافظه تصادفی» " -"درنظر گرفته شود." +"برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه _تصادفی_» " +"درنظر گرفته شود." #: src/why-rust/runtime.md:3 msgid "No undefined behavior at runtime:" -msgstr "هیچ رفتار تعریف نشده ای در زمان اجرا:" +msgstr "هیچ رفتار تعریف نشده‌ای در زمان اجرا:" #: src/why-rust/runtime.md:5 msgid "Array access is bounds checked." -msgstr "دسترسی به آرایه محدوده بررسی می شود." +msgstr "دسترسی به آرایه با بررسی محدوده چک می‌شود." #: src/why-rust/runtime.md:6 msgid "Integer overflow is defined (panic or wrap-around)." @@ -2833,10 +2833,10 @@ msgid "" "call functions such as `slice::get_unchecked` which does not do bounds " "checking." msgstr "" -"بررسی محدوده نمی تواند با پرچم کامپایل غیرفعال شود. همچنین نمی توان آن را به " +"بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را به " "طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به شما " -"امکان می دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " -"محدوده را انجام نمی دهد. " +"امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " +"محدوده را انجام نمی‌دهد. " #: src/why-rust/modern.md:3 msgid "Rust is built with all the experience gained in the last decades." @@ -2882,7 +2882,7 @@ msgstr "پشتیبانی درون-ساختی از تست نویسی" #: src/why-rust/modern.md:17 msgid "Excellent Language Server Protocol support." -msgstr "پشتیبانی عالی از پروتکل‌های سرور." +msgstr "پشتیبانی عالی از LSP‌." #: src/why-rust/modern.md:23 msgid "" @@ -2891,9 +2891,9 @@ msgid "" "writing a loop using `for` should result in roughly the same low level " "instructions as using the `.iter().fold()` construct." msgstr "" -"انتزاع‌هایی با هزینه صفر، مشابه C++، به این معنی است که " -"شما مجبور نیستید برای ساختارهای برنامه نویسی سطح بالاتر با حافظه یا CPU " -"«هزینه» ای پرداخت کنید. به عنوان مثال، نوشتن یک حلقه با استفاده از for باید " +"انتزاع‌های بدون هزینه، مشابه C++، به این معنی است که " +"شما مجبور نیستید برای ساختارهای برنامه‌نویسی سطح بالاتر با حافظه یا CPU " +"«هزینه»‌ای پرداخت کنید. به عنوان مثال، نوشتن یک حلقه با استفاده از for باید " "تقریباً به همان دستورالعمل‌های سطح پایین به عنوان استفاده از ساختار `iter().fold()` منجر شود." @@ -2903,8 +2903,8 @@ msgid "" "known as 'sum types', which allow the type system to express things like " "`Option` and `Result`." msgstr "" -"ارزش ذکر را دارد که شمارشگرهای زبان Rust از «انواع داده جبری» هستند که " -"همچنین به عنوان «انواع جمع» شناخته می شوند، که به سیستم نوع اجازه می دهد " +"ارزش ذکر را دارد که Enum‌های زبان Rust از «انواع داده جبری» هستند که " +"همچنین به عنوان «انواع جمع» شناخته می‌شوند، که به تایپ‌ سیستم اجازه می‌دهد " "چیزهایی مانند `Option` و `Result` را بیان کند." @@ -2916,9 +2916,9 @@ msgid "" "feedback, ready to copy-paste into your code." msgstr "" "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به " -"نادیده گرفتن خروجی طولانی کامپایلر عادت کرده اند. کامپایلر Rust به طور قابل " -"توجهی پرحرف تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را در " -"اختیار شما قرار می دهد که آماده کپی و پیست کردن در کد شما هستند." +"نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور قابل " +"توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را در " +"اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." #: src/why-rust/modern.md:37 msgid "" @@ -2928,12 +2928,12 @@ msgid "" msgstr "" "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go کوچک " "است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری در نظر " -"بگیرید همراه نیست:" +"بگیرید همراه نیست:" #: src/why-rust/modern.md:41 msgid "a random number generator, but see [rand](https://docs.rs/rand/)." msgstr "" -"یک ژنراتور عدد تصادفی، اما [کتابخانه `rand`](https://docs.rs/" +"یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://docs.rs/" "rand/) را ببینید." #: src/why-rust/modern.md:42 @@ -2955,9 +2955,9 @@ msgid "" "Rust community is still working on finding the best solution --- and perhaps " "there isn't a single \"best solution\" for some of these things." msgstr "" -"منطق پشت این امر این است که نمیتوان عملکردی را از کتابخانه استانداردحذف کرد، " -"بنابراین باید بسیار مانا باشد. برای مثال‌های بالا، جامعه Rust هنوز در تلاش " -"است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این موارد، یک " +"منطق پشت این امر این است که نمیتوان عملکردی را از کتابخانه استاندارد حذف کرد، " +"بنابراین باید بسیار پایدار باشد. برای مثال‌های بالا، جامعه Rust هنوز در تلاش " +"است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این موارد، یک " "«بهترین راه حل» وجود نداشته باشد. " #: src/why-rust/modern.md:50 @@ -2968,7 +2968,7 @@ msgid "" msgstr "" "زبان Rust همراه با یک مدیر بسته درون-ساختی به اسم Cargo ارائه می شود و این " "امر دانلود و کامپایل کردن crates شخص ثالث را بسیار آسان می کند. یکی از " -"پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." +"پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." #: src/why-rust/modern.md:54 msgid "" @@ -2978,7 +2978,7 @@ msgid "" msgstr "" "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای crates " -"به شما کمک می کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." +"به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." #: src/why-rust/modern.md:58 msgid "" @@ -2986,7 +2986,7 @@ msgid "" "implementation used in major IDEs and text editors." msgstr "" "[rust-analyzer](https://rust-analyzer.github.io/): یک پیاده سازی LSP است که " -"در IDE‌ها و ویرایشگرهای متن اصلی استفاده می شود." +"در IDE‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." #: src/basic-syntax.md:3 msgid "Much of the Rust syntax will be familiar to you from C, C++ or Java:" @@ -2994,23 +2994,23 @@ msgstr "بسیاری از دستور زبان Rust مشابه زبان‌های #: src/basic-syntax.md:5 msgid "Blocks and scopes are delimited by curly braces." -msgstr "بلاک‌ها و اسکوپ‌ها با پرانتزهای باز و بسته مشخص می شوند." +msgstr "بلاک‌ها و اسکوپ‌ها با پرانتزهای باز و بسته مشخص می‌شوند." #: src/basic-syntax.md:6 msgid "" "Line comments are started with `//`, block comments are delimited by `/* ... " "*/`." msgstr "" -"کامنت‌های تک خطی با ‍`//` شروع می شوند و کامنت‌های چند خطی با `/* ... */` مشخص " -"می شوند." +"کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` مشخص " +"می‌شوند." #: src/basic-syntax.md:8 msgid "Keywords like `if` and `while` work the same." -msgstr "کلمات کلیدی مانند `if `و `while` به همان صورت عمل می کنند." +msgstr "کلمات کلیدی مانند `if `و `while` به همان صورت عمل می‌کنند." #: src/basic-syntax.md:9 msgid "Variable assignment is done with `=`, comparison is done with `==`." -msgstr "انتساب متغیر با `=` انجام می شود، مقایسه با `==` انجام می شود." +msgstr "انتساب متغیر با `=` انجام می‌شود، مقایسه با `==` انجام می‌شود." #: src/basic-syntax/scalar-types.md:3 src/basic-syntax/compound-types.md:3 #: src/exercises/day-3/safe-ffi-wrapper.md:16 @@ -3023,7 +3023,7 @@ msgstr "مقادیر ثابت" #: src/basic-syntax/scalar-types.md:5 msgid "Signed integers" -msgstr "اعداد علامت‌دار" +msgstr "اعداد صحیح علامت‌دار" #: src/basic-syntax/scalar-types.md:5 msgid "`i8`, `i16`, `i32`, `i64`, `i128`, `isize`" @@ -3037,7 +3037,7 @@ msgstr "" #: src/basic-syntax/scalar-types.md:6 msgid "Unsigned integers" -msgstr "اعداد مثبت" +msgstr "اعداد صحیح مثبت" #: src/basic-syntax/scalar-types.md:6 msgid "`u8`, `u16`, `u32`, `u64`, `u128`, `usize`" @@ -3079,7 +3079,7 @@ msgstr "" #: src/basic-syntax/scalar-types.md:9 msgid "Unicode scalar values" -msgstr "مقادیر عددی یونی‌کد" +msgstr "مقادیر عددی یونیکد" #: src/basic-syntax/scalar-types.md:9 msgid "`char`" @@ -3133,13 +3133,13 @@ msgid "" msgstr "" "رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" " -"== \"\\\\n\"`.شما می توانید با استفاده از تعداد برابر `#` در دو طرف نقل " -"قول‌ها، نقل قول‌های دوگانه را جاسازی کنید:" +"== \"\\\\n\"`.شما می‌توانید با استفاده از تعداد برابر `#` در دو طرف دابل‌کوت " +"دابل‌کوت‌ها، دابل‌کوت‌ها را جاسازی کنید:" #: src/basic-syntax/scalar-types.md:35 msgid "Byte strings allow you to create a `&[u8]` value directly:" msgstr "" -"رشته‌های بایت به شما امکان می دهند مستقیماً یک مقدار `&[u8]``&[u8]` ایجاد کنید:" #: src/basic-syntax/scalar-types.md:45 @@ -3148,10 +3148,10 @@ msgid "" "`1_000` can be written as `1000` (or `10_00`), and `123_i64` can be written " "as `123i64`." msgstr "" -"می توان همه خطوط زیرین `_` را در اعداد حذف کرد، آنها فقط برای خوانایی " -"هستند. «`1_000` می تواند به صورت `1_000` می‌تواند به صورت `1000` (یا `10_00`) نوشته شود و `123_i64` می تواند به صورت `123i64` " +"dir=ltr>`123_i64` می‌تواند به صورت `123i64` " "نوشته شود.»" #: src/basic-syntax/compound-types.md:5 @@ -3207,12 +3207,12 @@ msgstr "" "span> (یک ثابت زمان کامپایل) عنصر از نوع یکسان `T` " "است. توجه داشته باشید که طول آرایه بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در " -"نظر گرفته می شوند." +"نظر گرفته می‌شوند." #: src/basic-syntax/compound-types.md:40 msgid "We can use literals to assign values to arrays." msgstr "" -"ما می توانیم از مقادیر ثابت برای انتساب مقادیر به آرایه‌ها استفاده کنیم." +"ما می‌توانیم از مقادیر ثابت برای انتساب مقادیر به آرایه‌ها استفاده کنیم." #: src/basic-syntax/compound-types.md:42 msgid "" @@ -3224,9 +3224,9 @@ msgid "" msgstr "" "ماکرو `println!` با پارامتر فرمت `?` نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش " -"فرض را می دهد، `{:?}` خروجی دیباگ را می دهد. انواع‌ای " -"مانند اعداد صحیح و رشته‌ها خروجی پیش فرض را پیاده سازی می کنند، اما آرایه‌ها " -"فقط خروجی دیباگ را پیاده سازی می کنند. این بدان معناست که ما باید در اینجا " +"فرض را می‌دهد، `{:?}` خروجی دیباگ را می‌دهد. انواع‌ای " +"مانند اعداد صحیح و رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، اما آرایه‌ها " +"فقط خروجی دیباگ را پیاده سازی می‌کنند. این بدان معناست که ما باید در اینجا " "از خروجی دیباگ استفاده کنیم." #: src/basic-syntax/compound-types.md:47 @@ -3235,11 +3235,11 @@ msgid "" "easier to read." msgstr "" "اضافه کردن `#`، مانند `{a:#?}`، یک " -"فرمت «چاپ زیبا» را فراخوانی می کند که می تواند خواندن آن را آسان تر کند." +"فرمت «چاپ زیبا» را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." #: src/basic-syntax/compound-types.md:49 msgid "Tuples:" -msgstr "تاپل‌ها" +msgstr ":تاپل‌ها" #: src/basic-syntax/compound-types.md:51 msgid "Like arrays, tuples have a fixed length." @@ -3247,14 +3247,14 @@ msgstr "مانند آرایه‌ها، تاپل‌ها نیز دارای طول #: src/basic-syntax/compound-types.md:53 msgid "Tuples group together values of different types into a compound type." -msgstr "تاپل‌ها مقادیر انواع مختلف را در یک نوع ترکیبی کنارهم قرار می‌دهند." +msgstr "تاپل‌ها مقادیر انواع مختلف را در یک نوع مرکب کنار هم قرار می‌دهند." #: src/basic-syntax/compound-types.md:55 msgid "" "Fields of a tuple can be accessed by the period and the index of the value, " "e.g. `t.0`, `t.1`." msgstr "" -"می توان به فیلدهای یک تاپل با استفاده از نقطه و شماره ایندکس مقدار، مانند " +"می‌توان به فیلدهای یک تاپل با استفاده از نقطه و شماره اندیس مقدار، مانند " "`t.0`، `t.1` دسترسی پیدا کرد." #: src/basic-syntax/compound-types.md:57 @@ -3264,10 +3264,10 @@ msgid "" "value are expressed as `()`. It is used to indicate, for example, that a " "function or expression has no return value, as we'll see in a future slide. " msgstr "" -"تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته می " -"شود. این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم " -"مقدار آن به صورت `()` بیان می شوند.رای مثال برای نشان " -"دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می شود، همانطور " +"تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته می‌شود." +" این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم " +"مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان " +"دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور " "که در اسلاید بعدی خواهیم دید. " #: src/basic-syntax/compound-types.md:61 @@ -5307,7 +5307,7 @@ msgstr "Ownership: حرکت semantics،copying و cloning, borrowing و lifetim #: src/welcome-day-2.md:10 #, fuzzy msgid "Structs and methods." -msgstr "رشته‌ها و تکرار کننده‌ها (Strings and Iterators)" +msgstr "رشته‌ها و تکرارکننده‌ها (Strings and Iterators)" #: src/welcome-day-2.md:12 msgid "" From e4a05ab54bf8e8f69b529372085ed886288c2bc2 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Sat, 4 Nov 2023 12:21:28 +0330 Subject: [PATCH 10/23] reformated --- po/fa.po | 85 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/po/fa.po b/po/fa.po index 7d3e99be4294..397cfe072be6 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1368,8 +1368,8 @@ msgid "" "C, C++, and Java." msgstr "" "در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد " -"استفاده از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت " -"تعامل با C، C++ و جاوا می‌شود." +"استفاده از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل " +"با C، C++ و جاوا می‌شود." #: src/running-the-course/course-structure.md:25 msgid "" @@ -2162,8 +2162,8 @@ msgid "" "You can of course adjust this as necessary. Please make sure to include " "breaks, we recommend a break every hour!" msgstr "" -"البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " -"را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" +"البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها را " +"نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" #: src/welcome-day-1/what-is-rust.md:3 msgid "" @@ -2345,8 +2345,9 @@ msgid "" msgstr "" "زبان Rust, یک زبان چند پارادایمی است. به عنوان مثال، دارای ویژگی‌های قدرتمند " "[برنامه نویسی شی‌گرا](https://doc.rust-lang.org/book/ch17-00-oop.html) است و " -"در حالی که یک زبان فانکشنال(`functional‍`) نیست، شامل طیف وسیعی از [مفاهیم فانکشنال]" -"(https://doc.rust-lang.org/book/ch13-00-functional-features.html) است." +"در حالی که یک زبان فانکشنال(`functional‍`) نیست، شامل طیف وسیعی از [مفاهیم " +"فانکشنال](https://doc.rust-lang.org/book/ch13-00-functional-features.html) " +"است." #: src/hello-world/small-example.md:3 msgid "Here is a small example program in Rust:" @@ -2476,8 +2477,8 @@ msgid "" "constructs like pattern matching and built-in dependency management." msgstr "" "تجربه با C یا C++ : زبان Rust با استفاده از بررسی کننده " -"قرض‌گیری (اشاره به مبحث قرض گرفتن یا `borrow`) ، یک سری کامل از _خطاهای " -"زمان اجرا_ را از بین می‌برد .t عملکردی مانند C و C++ را " +"قرض‌گیری (اشاره به مبحث قرض گرفتن یا `borrow`) ، یک سری کامل از _خطاهای زمان " +"اجرا_ را از بین می‌برد .t عملکردی مانند C و C++ را " "دارید اما مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن " "با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." @@ -2685,16 +2686,16 @@ msgid "" "Heap-allocated memory is freed via the `Drop` trait when the corresponding " "`Box` leaves the scope." msgstr "" -"حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که " -"`Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" +"حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که `Box` " +"مورد نظر اسکوپ مربوطه را ترک کند.‍" #: src/why-rust/an-example-in-c.md:85 msgid "" "Out-of-bounds accesses cause a panic or can be checked via the `get` method " "of a slice." msgstr "" -"دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد " -"get یک برش (`slice`) بررسی کرد." +"دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد get " +"یک برش (`slice`) بررسی کرد." #: src/why-rust/an-example-in-c.md:86 msgid "`match` mandates that all cases are handled." @@ -2779,8 +2780,8 @@ msgid "" "You can also accidentally create a [reference cycle](https://doc.rust-lang." "org/book/ch15-06-reference-cycles.html) with `Rc` or `Arc`." msgstr "" -"همچنین می‌توانید به طور تصادفی یک [چرخه ارجاع](https://doc.rust-lang.org/" -"book/ch15-06-reference-cycles.html) با `Rc` یا `Arc` ایجاد کنید." +"همچنین می‌توانید به طور تصادفی یک [چرخه ارجاع](https://doc.rust-lang.org/book/" +"ch15-06-reference-cycles.html) با `Rc` یا `Arc` ایجاد کنید." #: src/why-rust/compile-time.md:25 msgid "" @@ -2795,8 +2796,8 @@ msgid "" "For the purpose of this course, \"No memory leaks\" should be understood as " "\"Pretty much no _accidental_ memory leaks\"." msgstr "" -"برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه _تصادفی_» " -"درنظر گرفته شود." +"برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه " +"_تصادفی_» درنظر گرفته شود." #: src/why-rust/runtime.md:3 msgid "No undefined behavior at runtime:" @@ -2835,8 +2836,8 @@ msgid "" msgstr "" "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را به " "طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به شما " -"امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " -"محدوده را انجام نمی‌دهد. " +"امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی محدوده " +"را انجام نمی‌دهد. " #: src/why-rust/modern.md:3 msgid "Rust is built with all the experience gained in the last decades." @@ -2891,8 +2892,8 @@ msgid "" "writing a loop using `for` should result in roughly the same low level " "instructions as using the `.iter().fold()` construct." msgstr "" -"انتزاع‌های بدون هزینه، مشابه C++، به این معنی است که " -"شما مجبور نیستید برای ساختارهای برنامه‌نویسی سطح بالاتر با حافظه یا CPU " +"انتزاع‌های بدون هزینه، مشابه C++، به این معنی است که شما " +"مجبور نیستید برای ساختارهای برنامه‌نویسی سطح بالاتر با حافظه یا CPU " "«هزینه»‌ای پرداخت کنید. به عنوان مثال، نوشتن یک حلقه با استفاده از for باید " "تقریباً به همان دستورالعمل‌های سطح پایین به عنوان استفاده از ساختار `iter().fold()` منجر شود." @@ -2903,10 +2904,10 @@ msgid "" "known as 'sum types', which allow the type system to express things like " "`Option` and `Result`." msgstr "" -"ارزش ذکر را دارد که Enum‌های زبان Rust از «انواع داده جبری» هستند که " -"همچنین به عنوان «انواع جمع» شناخته می‌شوند، که به تایپ‌ سیستم اجازه می‌دهد " -"چیزهایی مانند `Option` و `Result` را بیان کند." +"ارزش ذکر را دارد که Enum‌های زبان Rust از «انواع داده جبری» هستند که همچنین " +"به عنوان «انواع جمع» شناخته می‌شوند، که به تایپ‌ سیستم اجازه می‌دهد چیزهایی " +"مانند `Option` و `Result` را بیان کند." #: src/why-rust/modern.md:32 msgid "" @@ -2933,8 +2934,8 @@ msgstr "" #: src/why-rust/modern.md:41 msgid "a random number generator, but see [rand](https://docs.rs/rand/)." msgstr "" -"یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://docs.rs/" -"rand/) را ببینید." +"یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://docs." +"rs/rand/) را ببینید." #: src/why-rust/modern.md:42 msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." @@ -2955,9 +2956,9 @@ msgid "" "Rust community is still working on finding the best solution --- and perhaps " "there isn't a single \"best solution\" for some of these things." msgstr "" -"منطق پشت این امر این است که نمیتوان عملکردی را از کتابخانه استاندارد حذف کرد، " -"بنابراین باید بسیار پایدار باشد. برای مثال‌های بالا، جامعه Rust هنوز در تلاش " -"است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این موارد، یک " +"منطق پشت این امر این است که نمیتوان عملکردی را از کتابخانه استاندارد حذف " +"کرد، بنابراین باید بسیار پایدار باشد. برای مثال‌های بالا، جامعه Rust هنوز در " +"تلاش است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این موارد، یک " "«بهترین راه حل» وجود نداشته باشد. " #: src/why-rust/modern.md:50 @@ -3148,11 +3149,10 @@ msgid "" "`1_000` can be written as `1000` (or `10_00`), and `123_i64` can be written " "as `123i64`." msgstr "" -"می‌توان همه خطوط زیرین `_` را در اعداد حذف کرد، آنها فقط برای خوانایی " -"هستند. «`1_000` می‌تواند به صورت `1000` (یا `10_00`) نوشته شود و `123_i64` می‌تواند به صورت `123i64` " -"نوشته شود.»" +"می‌توان همه خطوط زیرین `_` را در اعداد حذف کرد، آنها فقط برای خوانایی هستند. " +"«`1_000` می‌تواند به صورت `1000` " +"(یا `10_00`) نوشته شود و `123_i64` " +"می‌تواند به صورت `123i64` نوشته شود.»" #: src/basic-syntax/compound-types.md:5 msgid "Arrays" @@ -3211,8 +3211,7 @@ msgstr "" #: src/basic-syntax/compound-types.md:40 msgid "We can use literals to assign values to arrays." -msgstr "" -"ما می‌توانیم از مقادیر ثابت برای انتساب مقادیر به آرایه‌ها استفاده کنیم." +msgstr "ما می‌توانیم از مقادیر ثابت برای انتساب مقادیر به آرایه‌ها استفاده کنیم." #: src/basic-syntax/compound-types.md:42 msgid "" @@ -3226,8 +3225,8 @@ msgstr "" "span> نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش " "فرض را می‌دهد، `{:?}` خروجی دیباگ را می‌دهد. انواع‌ای " "مانند اعداد صحیح و رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، اما آرایه‌ها " -"فقط خروجی دیباگ را پیاده سازی می‌کنند. این بدان معناست که ما باید در اینجا " -"از خروجی دیباگ استفاده کنیم." +"فقط خروجی دیباگ را پیاده سازی می‌کنند. این بدان معناست که ما باید در اینجا از " +"خروجی دیباگ استفاده کنیم." #: src/basic-syntax/compound-types.md:47 msgid "" @@ -3264,11 +3263,11 @@ msgid "" "value are expressed as `()`. It is used to indicate, for example, that a " "function or expression has no return value, as we'll see in a future slide. " msgstr "" -"تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته می‌شود." -" این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم " -"مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان " -"دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور " -"که در اسلاید بعدی خواهیم دید. " +"تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته می‌شود. " +"این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم مقدار آن " +"به صورت `()` بیان می‌شوند.رای مثال برای نشان دادن اینکه " +"یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور که در اسلاید " +"بعدی خواهیم دید. " #: src/basic-syntax/compound-types.md:61 msgid "" From 779fb52fa49b66404995d1b440ad0cb799e833af Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Mon, 6 Nov 2023 12:07:26 +0330 Subject: [PATCH 11/23] Add translation until `#: src/basic-syntax/functions.md:3` --- po/fa.po | 88 ++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 76 insertions(+), 12 deletions(-) diff --git a/po/fa.po b/po/fa.po index 397cfe072be6..66e991d15fee 100644 --- a/po/fa.po +++ b/po/fa.po @@ -111,7 +111,7 @@ msgstr "ارجاعات تعلیق شده" #: src/SUMMARY.md:33 src/basic-syntax/slices.md:1 msgid "Slices" -msgstr "برش ها" +msgstr "برش‌ها" #: src/SUMMARY.md:34 msgid "String vs str" @@ -1740,7 +1740,7 @@ msgstr "" #: src/error-handling/converting-error-types-example.md:50 #: src/concurrency/threads.md:30 src/async/async-await.md:25 msgid "Key points:" -msgstr "امتیازات کلیدی:" +msgstr "نکات کلیدی:" #: src/cargo/rust-ecosystem.md:23 msgid "" @@ -3279,29 +3279,35 @@ msgstr "" #: src/basic-syntax/references.md:3 msgid "Like C++, Rust has references:" -msgstr "" +msgstr "مانند C++، Rust دارای مراجع است:" #: src/basic-syntax/references.md:15 msgid "Some notes:" -msgstr "" +msgstr "برخی از نکات:" #: src/basic-syntax/references.md:17 msgid "" "We must dereference `ref_x` when assigning to it, similar to C and C++ " "pointers." msgstr "" +"باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه " +"اشاره‌گرهای C و C++." #: src/basic-syntax/references.md:18 msgid "" "Rust will auto-dereference in some cases, in particular when invoking " "methods (try `ref_x.count_ones()`)." msgstr "" +"زبان Rust در برخی موارد به‌طور خودکار از ارجاع دهی صرف‌نظر می‌کند، به‌ویژه هنگام " +"فراخوانی متدها (`ref_x.count_ones()` را امتحان کنید)." #: src/basic-syntax/references.md:20 msgid "" "References that are declared as `mut` can be bound to different values over " "their lifetime." msgstr "" +"مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " +"مختلفی ارجاع داده شوند." #: src/basic-syntax/references.md:26 msgid "" @@ -3310,42 +3316,54 @@ msgid "" "to different values, while the second represents a reference to a mutable " "value." msgstr "" +"توجه داشته باشید که تفاوت بین `let mut ref_x: &i32` و " +"`let ref_x: &mut i32` را به خاطر بسپارید. اولی نمایانگر " +"یک مرجع قابل تغییر است که می‌تواند به مقادیر مختلفی ارجاع داده شود، در حالی " +"که دومی یک مرجع به یک مقدار قابل تغییر را نشان می‌دهد." #: src/basic-syntax/references-dangling.md:3 msgid "Rust will statically forbid dangling references:" -msgstr "" +msgstr "Rust از نظر استاتیکی مراجع (تعلیق شده)`dangling` را ممنوع می‌کند:" #: src/basic-syntax/references-dangling.md:17 msgid "A reference is said to \"borrow\" the value it refers to." -msgstr "" +msgstr "گفته می‌شود که یک مرجع مقدار مورد نظر خود را «قرض می‌گیرند»." #: src/basic-syntax/references-dangling.md:18 msgid "" "Rust is tracking the lifetimes of all references to ensure they live long " "enough." msgstr "" +"زبان Rust برای اینکه اطمینان حال کند طول‌عمر همه مراجع به اندازه کافی است, " +"آنها را رهگیری میکند." #: src/basic-syntax/references-dangling.md:20 msgid "We will talk more about borrowing when we get to ownership." msgstr "" +"هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت " +"خواهیم کرد." #: src/basic-syntax/slices.md:3 msgid "A slice gives you a view into a larger collection:" -msgstr "" +msgstr "یک برش به شما امکان می‌دهد نما (view) از یک مجموعه بزرگتر داشته باشید:" #: src/basic-syntax/slices.md:17 msgid "Slices borrow data from the sliced type." -msgstr "" +msgstr "برش‌ها داده‌ها را از نوع برش‌شده قرض می‌گیرند." #: src/basic-syntax/slices.md:18 msgid "Question: What happens if you modify `a[3]` right before printing `s`?" msgstr "" +"پرسش: اگر `a[3]` را درست قبل از چاپ `s` تغییر دهید چه اتفاقی می‌افتد؟" #: src/basic-syntax/slices.md:22 msgid "" "We create a slice by borrowing `a` and specifying the starting and ending " "indexes in brackets." msgstr "" +"ما با قرض گرفتن `a` و مشخص کردن ایندس‌های شروع و پایان " +"در براکت‌ها، برش (slice) ایجاد می‌کنیم." #: src/basic-syntax/slices.md:24 msgid "" @@ -3353,17 +3371,24 @@ msgid "" "starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " "identical." msgstr "" +"اگر برش را از اندیس 0 شروع شود، سینتکس زبانRust به ما اجازه می‌دهد اندیس شروع " +"را حذف کنیم (یعنی عدد صفر را ننویسیم)، به این معنی که `&a[0.." +"a.len()]` و `&a[..a.len()]` یکسان هستند." #: src/basic-syntax/slices.md:26 msgid "" "The same is true for the last index, so `&a[2..a.len()]` and `&a[2..]` are " "identical." msgstr "" +"در مورد اندیس آخر نیز همینطور است، بنابراین `&a[2..a.len()]` و `&a[2..]` یکسان هستند." #: src/basic-syntax/slices.md:28 msgid "" "To easily create a slice of the full array, we can therefore use `&a[..]`." msgstr "" +"یک روش ساده برای برش کل آرایه، این است که از `&a[..]` " +"استفاده کنیم." #: src/basic-syntax/slices.md:30 msgid "" @@ -3371,12 +3396,18 @@ msgid "" "(`&[i32]`) no longer mentions the array length. This allows us to perform " "computation on slices of different sizes." msgstr "" +"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع " +"`s` (`&[i32]`) دیگر طول آرایه را " +"ذکر نمی‌شود. این به ما امکان می‌دهد محاسباتی را روی برش‌هایی با اندازه‌های مختلف " +"انجام دهیم." #: src/basic-syntax/slices.md:32 msgid "" "Slices always borrow from another object. In this example, `a` has to remain " "'alive' (in scope) for at least as long as our slice. " msgstr "" +"برش‌ها همیشه از یک شیء دیگر قرض می گیرند. در این مثال، `a` باید حداقل به اندازه طول‌عمر برش ما، فعال (در محدوده) باقی بماند. " #: src/basic-syntax/slices.md:34 msgid "" @@ -3387,14 +3418,22 @@ msgid "" "`println`, when the slice is no longer used. More details will be explained " "in the borrow checker section." msgstr "" +"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع " +"کند، اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی توانید این کار را از " +"طریق `a` در این مرحله از اجرا انجام دهید، اما می‌توانید " +"داده ها را از هر دو `a` و `s` به " +"طور ایمن بخوانید. این کار قبل از ایجاد اسلایس و دوباره بعد از `println!` کار میکند، زمانی که برش دیگر استفاده نمی شود. " +"جزئیات بیشتری در بخش بررسی کننده‌قرض (the borrow checker) توضیح داده خواهیم " +"داد. " #: src/basic-syntax/string-slices.md:1 msgid "`String` vs `str`" -msgstr "" +msgstr "`String` در مقابل `str` " #: src/basic-syntax/string-slices.md:3 msgid "We can now understand the two string types in Rust:" -msgstr "" +msgstr "حالا می توانیم دو نوع رشته ای را در Rust درک کنیم:" #: src/basic-syntax/string-slices.md:5 msgid "" @@ -3416,15 +3455,17 @@ msgstr "" #: src/basic-syntax/string-slices.md:20 msgid "Rust terminology:" -msgstr "" +msgstr "اصطلاحات Rust:" #: src/basic-syntax/string-slices.md:22 msgid "`&str` an immutable reference to a string slice." msgstr "" +"&str یک مرجع غیرقابل تغییر " +"به یک برش رشته ای است." #: src/basic-syntax/string-slices.md:23 msgid "`String` a mutable string buffer." -msgstr "" +msgstr "`String` یک بافر رشته ای قابل تغییر است." #: src/basic-syntax/string-slices.md:27 msgid "" @@ -3432,12 +3473,18 @@ msgid "" "encoded string data stored in a block of memory. String literals " "(`”Hello”`), are stored in the program’s binary." msgstr "" +"`&str` یک برش رشته ای را معرفی می کند، که یک مرجع " +"غیرقابل تغییر به داده های رشته ای انکود شده UTF-8 است که در یک بلوک حافظه " +"ذخیره شده است. لیترال های رشته ای `String` (`”Hello”`) " +"در باینری برنامه ذخیره می شوند." #: src/basic-syntax/string-slices.md:30 msgid "" "Rust’s `String` type is a wrapper around a vector of bytes. As with a " "`Vec`, it is owned." msgstr "" +"در زبان Rust نوع ‍`String` یک wrapper برای یک بردار از " +"بایت‌هاست. به عنوان `Vec` وجود دارد، مالکیت آن دارد." #: src/basic-syntax/string-slices.md:32 msgid "" @@ -3445,18 +3492,28 @@ msgid "" "literal; `String::new()` creates a new empty string, to which string data " "can be added using the `push()` and `push_str()` methods." msgstr "" +"مانند بسیاری از انواع دیگر، `String::from()` یک رشته از " +"یک لیترال رشته ایجاد می کند. `String::new()` ک رشته " +"خالی جدید ایجاد می کند که داده های رشته ای می توانند با استفاده از متدهای " +"`push()` و `push_str()` به آن " +"اضافه شوند." #: src/basic-syntax/string-slices.md:35 msgid "" "The `format!()` macro is a convenient way to generate an owned string from " "dynamic values. It accepts the same format specification as `println!()`." msgstr "" +"ماکرو `format!()` یک راه راحت برای ایجاد یک رشته متعلق " +"به مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!" +"()` است." #: src/basic-syntax/string-slices.md:38 msgid "" "You can borrow `&str` slices from `String` via `&` and optionally range " "selection." msgstr "" +"شما می توانید برش‌های &str را از `String` از طریق `&` و " +"انتخاب محدوده به صورت اختیاری، قرض بگیرید." #: src/basic-syntax/string-slices.md:40 msgid "" @@ -3465,6 +3522,13 @@ msgid "" "equivalent of `std::string` from C++ (main difference: it can only contain " "UTF-8 encoded bytes and will never use a small-string optimization)." msgstr "" +"برای برنامه نویسان `C++`: `&str`را به عنوان `const char*` در `C++` درنظر بگیرید، اما یک فرق مهم این است که در راست که همیشه به یک رشته " +"معتبر در حافظه اشاره می کند. زبان Rust نوع `String`معادل تقریبی `std::string` در `C++` است (با این تفاوت که فقط می تواند حاوی بایت های انکودینگ شده UTF-8 " +"باشد و هرگز از بهینه سازی رشته کوچک استفاده نمی کند)." #: src/basic-syntax/functions.md:3 msgid "" From 0b264fa6be96869ab6278ebafdcee2acc1fcd7a6 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Mon, 6 Nov 2023 13:07:35 +0330 Subject: [PATCH 12/23] Add translation until `#: src/exercises/day-1/implicit-conversions.md:3` --- po/fa.po | 88 +++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 72 insertions(+), 16 deletions(-) diff --git a/po/fa.po b/po/fa.po index 66e991d15fee..f89d11684fbe 100644 --- a/po/fa.po +++ b/po/fa.po @@ -3535,41 +3535,59 @@ msgid "" "A Rust version of the famous [FizzBuzz](https://en.wikipedia.org/wiki/" "Fizz_buzz) interview question:" msgstr "" +"یک نسخه به زبان Rust از سوال مصاحبه معروف [FizzBuzz](https://en.wikipedia." +"org/wiki/Fizz_buzz):" #: src/basic-syntax/functions.md:36 msgid "" "We refer in `main` to a function written below. Neither forward declarations " "nor headers are necessary. " msgstr "" +"ما در `main` به یک تابعی که در زیرش نوشته شده است اشاره " +"می کنیم. نیازی به اعلان از قبل تابع `main` یا در بخش " +"هدر نیست. " #: src/basic-syntax/functions.md:37 msgid "" "Declaration parameters are followed by a type (the reverse of some " "programming languages), then a return type." msgstr "" +"بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف " +"برخی از زبان‌های برنامه‌نویسی)." #: src/basic-syntax/functions.md:38 msgid "" "The last expression in a function body (or any block) becomes the return " "value. Simply omit the `;` at the end of the expression." msgstr "" +"آخرین عبارت در بدنه تابع (یا هر بلوک دیگری) به عنوان مقدار برگشتی در نظر " +"گرفته می‌شود. به همین سادگی `;` را میتوان در انتهای " +"عبارت حذف کنید." #: src/basic-syntax/functions.md:39 msgid "" "Some functions have no return value, and return the 'unit type', `()`. The " "compiler will infer this if the `-> ()` return type is omitted." msgstr "" +"برخی از توابع هیچ مقدار برگشتی ندارند و «نوع یکه» `()` " +"را برمی گردانند. اگر `-> ()` از بخش نوع برگشتی حذف شود، " +"کامپایلر این را استنتاج خواهد داشت که هیچ نوع برگشتی وجود ندارد." #: src/basic-syntax/functions.md:40 msgid "" "The range expression in the `for` loop in `print_fizzbuzz_to()` contains " "`=n`, which causes it to include the upper bound." msgstr "" +"عبارت تعیین محدوده در حلقه `for` در `print_fizzbuzz_to()` حاوی `=n` است که " +"باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." #: src/basic-syntax/rustdoc.md:3 msgid "" "All language items in Rust can be documented using special `///` syntax." msgstr "" +"همه موارد زبانی در Rust را می‌توان با استفاده از سینتکس ویژه `///` داکیومنت " +"شوند." #: src/basic-syntax/rustdoc.md:5 msgid "" @@ -3601,24 +3619,36 @@ msgid "" "idiomatic to document all public items in an API using this pattern. Code " "snippets can document usage and will be used as unit tests." msgstr "" +"محتوا کامنت شده به عنوان `Markdown` در نظر گرفته می‌شود. تمام جعبه‌هایی که در " +"Rust منتشر می‌شوند به‌طور خودکار با استفاده از ابزار [rustdoc](https://doc." +"rust-lang.org/rustdoc/what-is-rustdoc.html) در [`docs.rs`](https://docs.rs) " +"مستند می‌شوند. این یک سبک رایج است که تمام آیتم‌های عمومی در یک API با استفاده " +"از این الگو داکیونت شود.همچنین میتوان قطعه کدهایی شامل نحوه استفاده را " +"داکیومنت کرد و به عنوان تست‌های واحد (unit tests) استفاده خواهند شد." #: src/basic-syntax/rustdoc.md:30 msgid "" "Show students the generated docs for the `rand` crate at [`docs.rs/rand`]" "(https://docs.rs/rand)." msgstr "" +"دانشجویان را با داکیومنت‌های تولید شده برای جعبه `rand` در [`docs.rs/rand`]" +"(https://docs.rs/rand) آشنا کنید." #: src/basic-syntax/rustdoc.md:33 msgid "" "This course does not include rustdoc on slides, just to save space, but in " "real code they should be present." msgstr "" +"این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، " +"اما در کدهای دنیای واقعی باید وجود داشته باشد." #: src/basic-syntax/rustdoc.md:36 msgid "" "Inner doc comments are discussed later (in the page on modules) and need not " "be addressed here." msgstr "" +"کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار " +"می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." #: src/basic-syntax/rustdoc.md:39 msgid "" @@ -3626,12 +3656,17 @@ msgid "" "`cargo test`. We will discuss these tests in the [Testing section](../" "testing/doc-tests.html)." msgstr "" +"کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با " +"استفاده از `cargo test` اجرا و تست کنیم. ما در [بخش " +"تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم کرد." #: src/basic-syntax/methods.md:3 msgid "" "Methods are functions associated with a type. The `self` argument of a " "method is an instance of the type it is associated with:" msgstr "" +"متدها تابع‌هایی هستند که به یک نوع خاص هستند. آرگومان `self` یک متد، نمونه‌ای " +"از نوعی است که با آن مرتبط است:" #: src/basic-syntax/methods.md:6 msgid "" @@ -3664,11 +3699,13 @@ msgstr "" msgid "" "We will look much more at methods in today's exercise and in tomorrow's " "class." -msgstr "" +msgstr "در تمرین امروز و کلاس فردا بیشتر به متدها می‌پردازیم." #: src/basic-syntax/methods.md:34 msgid "Add a static method called `Rectangle::new` and call this from `main`:" msgstr "" +"یک متد استاتیک به نام `Rectangle::new` اضافه کنید و آن " +"را از `main` فراخوانی کنید:" #: src/basic-syntax/methods.md:42 msgid "" @@ -3677,48 +3714,56 @@ msgid "" "constructor, `Rectangle { width, height }`, could be called directly. See " "the [Rustnomicon](https://doc.rust-lang.org/nomicon/constructors.html)." msgstr "" +"در حالی که از _نظر فنی_ زبان Rust یک متد سازنده خاص ندارد، معمولاً از " +"متدهای استاتیک برای مقداردهی اولیه ساختارها استفاده می‌شود (اما الزامی " +"نیست). سازنده اصلی ، `Rectangle { width, height }` ، " +"را می‌تواند به طور مستقیم فراخوانی کرد. برای اطلاعات بیشتر [Rustnomicon]" +"(https://doc.rust-lang.org/nomicon/constructors.html) را ببینید." #: src/basic-syntax/methods.md:45 msgid "" "Add a `Rectangle::square(width: u32)` constructor to illustrate that such " "static methods can take arbitrary parameters." msgstr "" +"برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه " +"بگیرند، با ارگمان‌های یک سازنده `Rectangle::square(width: " +"u32)` اضافه کنید." #: src/basic-syntax/functions-interlude.md:1 msgid "Function Overloading" -msgstr "" +msgstr "سربارگذاری تابع (Function Overloading)" #: src/basic-syntax/functions-interlude.md:3 msgid "Overloading is not supported:" -msgstr "" +msgstr "سربارگذاری پشتیبانی نمیشود, چون:" #: src/basic-syntax/functions-interlude.md:5 msgid "Each function has a single implementation:" -msgstr "" +msgstr "هر تابع پیاده سازی یکتایی دارد:" #: src/basic-syntax/functions-interlude.md:6 msgid "Always takes a fixed number of parameters." -msgstr "" +msgstr "همیشه تعداد ثابتی از آرگومان‌ها می‌گیرد." #: src/basic-syntax/functions-interlude.md:7 msgid "Always takes a single set of parameter types." -msgstr "" +msgstr "همیشه یک مجموعه واحد از انواع آرگومان‌ها ار می‌گیرد." #: src/basic-syntax/functions-interlude.md:8 msgid "Default values are not supported:" -msgstr "" +msgstr "مقادیر پیش فرض پشتیبانی نمی شوند:" #: src/basic-syntax/functions-interlude.md:9 msgid "All call sites have the same number of arguments." -msgstr "" +msgstr "تمام محل‌های فراخوانی دارای تعداد یکسانی از آرگومان هستند." #: src/basic-syntax/functions-interlude.md:10 msgid "Macros are sometimes used as an alternative." -msgstr "" +msgstr "گاهی اوقات از ماکروها به عنوان جایگزین این کار استفاده می‌شود." #: src/basic-syntax/functions-interlude.md:12 msgid "However, function parameters can be generic:" -msgstr "" +msgstr "با این حال، پارامترهای تابع می‌توانند جنریک باشند:" #: src/basic-syntax/functions-interlude.md:14 msgid "" @@ -3740,26 +3785,29 @@ msgid "" "limited polymorphism on argument types. We will see more details in a later " "section." msgstr "" +"هنگام استفاده از جنریک‌ها، `Into` کتابخانه استاندارد " +"می تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها فراهم کند. " +"جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." #: src/exercises/day-1/morning.md:1 msgid "Day 1: Morning Exercises" -msgstr "" +msgstr "روز اول: تمرین‌های صبحگاه" #: src/exercises/day-1/morning.md:3 msgid "In these exercises, we will explore two parts of Rust:" -msgstr "" +msgstr "در این تمرین‌ها، دو بخش از Rust را بررسی خواهیم کرد:" #: src/exercises/day-1/morning.md:5 msgid "Implicit conversions between types." -msgstr "" +msgstr "تبدیل‌های صریح بین انواع" #: src/exercises/day-1/morning.md:7 msgid "Arrays and `for` loops." -msgstr "" +msgstr "آرایه‌ها و حلقه‌های `for`" #: src/exercises/day-1/morning.md:11 msgid "A few things to consider while solving the exercises:" -msgstr "" +msgstr "چند نکته را هنگام حل تمرین‌ها درنظر بگیرید:" #: src/exercises/day-1/morning.md:13 msgid "" @@ -3767,16 +3815,22 @@ msgid "" "completion in your editor. See the page about [Using Cargo](../../cargo.md) " "for details on installing Rust." msgstr "" +"در صورت امکان، از نصب محلی Rust استفاده کنید. از این طریق می‌توانید از تکمیل " +"خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب Rust، " +"صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." #: src/exercises/day-1/morning.md:17 msgid "Alternatively, use the Rust Playground." -msgstr "" +msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." #: src/exercises/day-1/morning.md:19 msgid "" "The code snippets are not editable on purpose: the inline code snippets lose " "their state if you navigate away from the page." msgstr "" +"قطعه کدها به صورت عمدی قابل ویرایش با ماندگاری تغییرات نیستند: قطعه کدهای " +"درون‌خطی اگر از صفحه خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات " +"شما درنظر گرفته نمی‌شود." #: src/exercises/day-1/morning.md:22 src/exercises/day-2/morning.md:11 #: src/exercises/day-3/morning.md:9 src/exercises/bare-metal/morning.md:7 @@ -3785,6 +3839,8 @@ msgid "" "After looking at the exercises, you can look at the [solutions](solutions-" "morning.md) provided." msgstr "" +"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها](solutions-morning.md) ارائه شده " +"نگاه کنید." #: src/exercises/day-1/implicit-conversions.md:3 msgid "" From 71fbc667681b3d727bcd9eeb815d609a633a349f Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Mon, 6 Nov 2023 18:26:54 +0330 Subject: [PATCH 13/23] Add translation until `#: src/control-flow.md:3` --- po/fa.po | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 64 insertions(+), 7 deletions(-) diff --git a/po/fa.po b/po/fa.po index f89d11684fbe..f923943d13f1 100644 --- a/po/fa.po +++ b/po/fa.po @@ -3839,7 +3839,7 @@ msgid "" "After looking at the exercises, you can look at the [solutions](solutions-" "morning.md) provided." msgstr "" -"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها](solutions-morning.md) ارائه شده " +"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده " "نگاه کنید." #: src/exercises/day-1/implicit-conversions.md:3 @@ -3848,6 +3848,9 @@ msgid "" "([unlike C++](https://en.cppreference.com/w/cpp/language/" "implicit_conversion)). You can see this in a program like this:" msgstr "" +"Rust به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " +"`C++`](https://en.cppreference.com/w/cpp/language/" +"implicit_conversion)).به عنوان مثال میتونید این رو توی یک برنامه ببنید:" #: src/exercises/day-1/implicit-conversions.md:20 msgid "" @@ -3858,6 +3861,15 @@ msgid "" "trait has a single `into()` method. Implementing these traits is how a type " "expresses that it can be converted into another type." msgstr "" +"همه انواع عدد صحیح Rust، ویژگی‌های [`Into`](https://" +"doc.rust-lang.org/std/convert/trait.Into.html) و [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) را پیاده‌سازی " +"می‌کنندتا به ما امکان تبدیل بین انواع عددی صحیح را فراهم کنند. با پیاده سازی " +"ویژگی `From` همه انواع به صورت مشترک یک متد `from()` را دارند. با پیاده سازی ویژگی `Into` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این ویژگی‌ها راهی است که یک نوع " +"بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." #: src/exercises/day-1/implicit-conversions.md:26 msgid "" @@ -3867,6 +3879,13 @@ msgid "" "i16` implementation automatically create an implementation of `Into for " "i8`." msgstr "" +"کتابخانه استاندارد پیاده‌سازی `From i16` به نوع " +"`i16` دارد، به این معنی که می‌توانیم یک متغیر `x` از نوع " +"`i8` را با فراخوانی `i16::from(x)` به یک `i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x." +"into()` ، زیرا پیاده‌سازی `From` برای نوع " +"`i16` به طور خودکار پیاده‌سازی`Into` براینوع `i8` را ایجاد می‌کند." #: src/exercises/day-1/implicit-conversions.md:31 msgid "" @@ -3874,14 +3893,20 @@ msgid "" "it is sufficient to only implement `From` to get a respective `Into` " "implementation automatically." msgstr "" +"همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع " +"خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را " +"پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` مربوطه " +"را دریافت کنید." #: src/exercises/day-1/implicit-conversions.md:34 msgid "Execute the above program and look at the compiler error." -msgstr "" +msgstr "برنامه فوق را اجرا کنید و به خطای کامپایلر نگاه کنید." #: src/exercises/day-1/implicit-conversions.md:36 msgid "Update the code above to use `into()` to do the conversion." msgstr "" +"کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` " +"برای انجام تبدیل استفاده شود." #: src/exercises/day-1/implicit-conversions.md:38 msgid "" @@ -3891,27 +3916,37 @@ msgid "" "[standard library documentation](https://doc.rust-lang.org/std/convert/trait." "From.html) to see if `From` is implemented for the pairs you check." msgstr "" +"نوع داده `x` و `y` را به چیزهای دیگری (مانند `f32`, `bool`, `i128`) تغییر " +"دهید تا ببینید کدام انواع را می‌توانید به کدام انواع دیگر تبدیل کنید. سعی " +"کنید انواع کوچک را به انواع بزرگ تبدیل کنید و برعکس. [مستندات کتابخانه " +"استاندارد](https://doc.rust-lang.org/std/convert/trait.From.html) را بررسی " +"کنید تا ببینید آیا `From` برای تبدیل نوع‌هاییکه " +"بررسی می‌کنید پیاده‌سازی شده است یا نه." #: src/exercises/day-1/for-loops.md:1 #: src/exercises/day-1/solutions-morning.md:3 msgid "Arrays and `for` Loops" -msgstr "" +msgstr "آرایه‌ها و حلقه‌های `for`" #: src/exercises/day-1/for-loops.md:3 msgid "We saw that an array can be declared like this:" -msgstr "" +msgstr "دیدیم که یک آرایه را می‌توان به صورت زیر تعریف کرد: " #: src/exercises/day-1/for-loops.md:9 msgid "" "You can print such an array by asking for its debug representation with `{:?}" "`:" msgstr "" +"می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" #: src/exercises/day-1/for-loops.md:19 msgid "" "Rust lets you iterate over things like arrays and ranges using the `for` " "keyword:" msgstr "" +"زبان Rust به شما این امکان می‌دهد با استفاده از کلمه کلیدی `for` بر روی " +"چیزهایی مانند آرایه‌ها و رنج‌ها پیمایش کنید:" #: src/exercises/day-1/for-loops.md:22 msgid "" @@ -3939,16 +3974,22 @@ msgid "" "and a function `transpose` which will transpose a matrix (turn rows into " "columns):" msgstr "" +"از موارد فوق برای نوشتن تابع `pretty_print` که یک " +"ماتریس را به صورت `pretty-print` چاپ می‌کند و تابع " +"`transpose` که یک ماتریس را جابجا می‌کند (ردیف‌ها را به " +"ستون‌ها تبدیل می‌کند) استفاده کنید: " #: src/exercises/day-1/for-loops.md:49 msgid "Hard-code both functions to operate on 3 × 3 matrices." -msgstr "" +msgstr "هر دو تابع را برای کار بر روی ماتریس‌های 3 × 3 هاردکد کنید." #: src/exercises/day-1/for-loops.md:51 msgid "" "Copy the code below to and implement the " "functions:" msgstr "" +"کد زیر را در کپی کنید و " +"توابع را پیاده‌سازی کنید:" #: src/exercises/day-1/for-loops.md:54 msgid "" @@ -3983,7 +4024,7 @@ msgstr "" #: src/exercises/day-1/for-loops.md:82 msgid "Bonus Question" -msgstr "" +msgstr "سوال جایزه" #: src/exercises/day-1/for-loops.md:84 msgid "" @@ -3991,28 +4032,39 @@ msgid "" "argument and return types? Something like `&[&[i32]]` for a two-dimensional " "slice-of-slices. Why or why not?" msgstr "" +"آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده کنید؟ " +"چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. آیا " +"امکان پذیر هست؟ اگر نه چرا؟" #: src/exercises/day-1/for-loops.md:89 msgid "" "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production quality " "implementation." msgstr "" +"برای دیدن یک پیاده سازی برای محیط پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." #: src/exercises/day-1/for-loops.md:94 msgid "" "The solution and the answer to the bonus section are available in the " "[Solution](solutions-morning.md#arrays-and-for-loops) section." msgstr "" +"راه‌حل‌ها و پاسخ به بخش جایزه در بخش جواب‌ها](solutions-morning.md#arrays-and-" +"for-loops) موجود است." #: src/exercises/day-1/for-loops.md:97 msgid "" "The use of the reference `&array` within `for n in &array` is a subtle " "preview of issues of ownership that will come later in the afternoon." msgstr "" +"استفاده از ارجاع `&array` در بخش `for n " +"in &array` پیش‌نمایشی از مسئله مالکیت است که بعداً توی قسمت عصر به ان " +"خواهیم پرداخت." #: src/exercises/day-1/for-loops.md:100 msgid "Without the `&`..." -msgstr "" +msgstr "بدون استفاده از `&` ..." #: src/exercises/day-1/for-loops.md:101 msgid "" @@ -4020,12 +4072,17 @@ msgid "" "[introduced in the 2021 Edition](https://doc.rust-lang.org/edition-guide/" "rust-2021/IntoIterator-for-arrays.html)." msgstr "" +"حلقه به گونه‌ای می‌بود که آرایه را مصرف می‌کند. این تغییری [در ویرایش سال ۲۰۲۱ " +"معرفی شده است.](https://doc.rust-lang.org/edition-guide/rust-2021/" +"IntoIterator-for-arrays.html)" #: src/exercises/day-1/for-loops.md:104 msgid "" "An implicit array copy would have occurred. Since `i32` is a copy type, " "then `[i32; 3]` is also a copy type." msgstr "" +"یک کپی آرایه ضمنی رخ می‌داد. از آنجایی که `i32` یک نوع کپی است، پس `[i32; 3]` نیز یک نوع کپی است." #: src/control-flow.md:3 msgid "" From fd64ad253a86184c594268cb90a1cfd07452bad5 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Tue, 7 Nov 2023 12:52:50 +0330 Subject: [PATCH 14/23] Add translation until `#: src/basic-syntax/variables.md:3` --- po/fa.po | 68 ++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 9 deletions(-) diff --git a/po/fa.po b/po/fa.po index f923943d13f1..bcc1430a720f 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4091,58 +4091,75 @@ msgid "" "becomes the value of the `if` expression. Other control flow expressions " "work similarly in Rust." msgstr "" +"همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده " +"میشود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در " +"راست این بلاک های `if` میتوانند یک مقدار را برگرداند و اصطلاحا یک مقدار " +"داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." #: src/control-flow/blocks.md:3 msgid "" "A block in Rust contains a sequence of expressions. Each block has a value " "and a type, which are those of the last expression of the block:" msgstr "" +"یک بلاک در Rust میتواند حاوی چندین عبارات باشد. هر بلاک دارای یک مقدار و یک " +"نوع بازگشتی است که مربوط به آخرین عبارت در ان بلاک می‌باشد:" #: src/control-flow/blocks.md:27 msgid "" "If the last expression ends with `;`, then the resulting value and type is " "`()`." -msgstr "" +msgstr "اگر آخرین عبارت با `;` پایان یابد، مقدار و نوع بازگشتی `()` است." #: src/control-flow/blocks.md:29 msgid "" "The same rule is used for functions: the value of the function body is the " "return value:" msgstr "" +"قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار " +"برگشتی است: " #: src/control-flow/blocks.md:45 src/enums.md:34 src/enums/sizes.md:28 #: src/pattern-matching.md:25 src/pattern-matching/match-guards.md:22 #: src/structs.md:31 src/methods.md:30 src/methods/example.md:46 msgid "Key Points:" -msgstr "" +msgstr "نکات کلیدی" #: src/control-flow/blocks.md:46 msgid "" "The point of this slide is to show that blocks have a type and value in " "Rust. " msgstr "" +"هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " +"بازگشتی هستند." #: src/control-flow/blocks.md:47 msgid "" "You can show how the value of the block changes by changing the last line in " "the block. For instance, adding/removing a semicolon or using a `return`." msgstr "" +"می‌توانید نشان دهید که چگونه با تغییر خط آخر بلاک مقدار و نوع بازگشتی تغییر " +"می‌کند. به عنوان مثال با اضافه کردن یا حذف کردن یک `;` یا با استفاده از کلید " +"واژه `return` تغییرات را اعمال کنید." #: src/control-flow/if-expressions.md:1 msgid "`if` expressions" -msgstr "" +msgstr "عبارت `if`" #: src/control-flow/if-expressions.md:3 msgid "" "You use [`if` expressions](https://doc.rust-lang.org/reference/expressions/" "if-expr.html#if-expressions) exactly like `if` statements in other languages:" msgstr "" +"شما [عبارت `if`](https://doc.rust-lang.org/reference/expressions/if-expr." +"html#if-expressions) رو به مانند دیگر زبان‌ها استفاده می‌کنید:" #: src/control-flow/if-expressions.md:18 msgid "" "In addition, you can use `if` as an expression. The last expression of each " "block becomes the value of the `if` expression:" msgstr "" +"در کنار این موضوع, می‌توانید از if به عنوان یک عبارت با قابلیت بازگشت مقدار " +"هم استفاده کنید. آخرین عبارت توی هر بلاک if اون مقدار و نوع بازگشتی است:" #: src/control-flow/if-expressions.md:35 msgid "" @@ -4150,10 +4167,13 @@ msgid "" "branch blocks must have the same type. Consider showing what happens if you " "add `;` after `x / 2` in the second example." msgstr "" +"از آنجایی که ‍`if` یک عبارت است و باید نوع خاصی داشته باشد، هر دو بلاک (`if` " +"و `else`) باید از نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از " +"`x / 2` در مثال دوم `;` اضافه کنید، چه اتفاقی می افتد. " #: src/control-flow/for-expressions.md:1 msgid "`for` loops" -msgstr "" +msgstr "حلقه `for`" #: src/control-flow/for-expressions.md:3 msgid "" @@ -4161,85 +4181,112 @@ msgid "" "related to the [`while let` loop](while-let-expressions.md). It will " "automatically call `into_iter()` on the expression and then iterate over it:" msgstr "" +"[حلقه `for`](https://doc.rust-lang.org/std/keyword.for.html) به طور نزدیکی " +"به حلقه [حلقه `while let` ](while-let-expressions.md) مرتبط است. حلقه `for` " +"به طور خودکار `into_iter()` را روی عبارت فراخوانی " +"می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" #: src/control-flow/for-expressions.md:22 msgid "You can use `break` and `continue` here as usual." msgstr "" +"مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده کنید." #: src/control-flow/for-expressions.md:26 msgid "Index iteration is not a special syntax in Rust for just that case." -msgstr "" +msgstr "پیشمایش اندیس در زبان راست دارای سینتکس خاصی نمی‌باشد." #: src/control-flow/for-expressions.md:27 msgid "`(0..10)` is a range that implements an `Iterator` trait. " msgstr "" +"(0..10) یک محدوده است که ویژگی " +"`Iterator` را پیاده‌سازی می‌کند." #: src/control-flow/for-expressions.md:28 msgid "" "`step_by` is a method that returns another `Iterator` that skips every other " "element. " msgstr "" +"متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن بقیه " +"عناصر را برمی‌گرداند." #: src/control-flow/for-expressions.md:29 msgid "" "Modify the elements in the vector and explain the compiler errors. Change " "vector `v` to be mutable and the for loop to `for x in v.iter_mut()`." msgstr "" +"عناصر را در بردار تغییر دهید و خطاهای کامپایلر را توضیح دهید. بردار v را " +"قابل تغییر کنید (با اضافه کردن `mut`) و حلقه `for` را به `for " +"x in v.iter_mut()` تغییر دهید." #: src/control-flow/while-expressions.md:1 msgid "`while` loops" -msgstr "" +msgstr "حلقه `while`" #: src/control-flow/while-expressions.md:3 msgid "" "The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-" "expr.html#predicate-loops) works very similar to other languages:" msgstr "" +"[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-" +"expr.html#predicate-loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند:" #: src/control-flow/break-continue.md:1 msgid "`break` and `continue`" -msgstr "" +msgstr "`break` و `continue`" #: src/control-flow/break-continue.md:3 msgid "" "If you want to exit a loop early, use [`break`](https://doc.rust-lang.org/" "reference/expressions/loop-expr.html#break-expressions)," msgstr "" +"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang." +"org/reference/expressions/loop-expr.html#break-expressions) استفاده کنید," #: src/control-flow/break-continue.md:4 msgid "" "If you want to immediately start the next iteration use [`continue`](https://" "doc.rust-lang.org/reference/expressions/loop-expr.html#continue-expressions)." msgstr "" +"اگر می‌خواهید بلافاصله تکرار بعدی را شروع کنید، از [`continue`](https://doc." +"rust-lang.org/reference/expressions/loop-expr.html#continue-expressions) " +"استفاده کنید." #: src/control-flow/break-continue.md:7 msgid "" "Both `continue` and `break` can optionally take a label argument which is " "used to break out of nested loops:" msgstr "" +"کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان " +"برچسب (label) بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" #: src/control-flow/break-continue.md:29 msgid "" "In this case we break the outer loop after 3 iterations of the inner loop." -msgstr "" +msgstr "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." #: src/control-flow/loop-expressions.md:1 msgid "`loop` expressions" -msgstr "" +msgstr "عبارت `loop`" #: src/control-flow/loop-expressions.md:3 msgid "" "Finally, there is a [`loop` keyword](https://doc.rust-lang.org/reference/" "expressions/loop-expr.html#infinite-loops) which creates an endless loop." msgstr "" +"در نهایت، [کلمه کلیدی `loop`](https://doc.rust-lang.org/reference/" +"expressions/loop-expr.html#infinite-loops) وجود دارد که یک حلقه بی‌پایان " +"ایجاد می‌کند." #: src/control-flow/loop-expressions.md:6 msgid "Here you must either `break` or `return` to stop the loop:" msgstr "" +"اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده کنید:" #: src/control-flow/loop-expressions.md:28 msgid "Break the `loop` with a value (e.g. `break 8`) and print it out." msgstr "" +"حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break " +"8` ) و آن را چاپ کنید." #: src/control-flow/loop-expressions.md:29 msgid "" @@ -4247,6 +4294,9 @@ msgid "" "value. This is because it's guaranteed to be entered at least once (unlike " "`while` and `for` loops)." msgstr "" +"توجه داشته باشید که loop تنها ساختار حلقه‌ای است که یک مقدار **non-trivial** " +"را برمی‌گرداند. این به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود " +"(برخلاف حلقه‌های `while` و `for`)." #: src/basic-syntax/variables.md:3 msgid "" From 0decc0299027452250b3df49acc1b87ace9f51c2 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Tue, 7 Nov 2023 14:02:57 +0330 Subject: [PATCH 15/23] Add translation until `#: src/enums/sizes.md:3` --- po/fa.po | 133 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 116 insertions(+), 17 deletions(-) diff --git a/po/fa.po b/po/fa.po index bcc1430a720f..2c671a0b187d 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4303,22 +4303,28 @@ msgid "" "Rust provides type safety via static typing. Variable bindings are immutable " "by default:" msgstr "" +"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت " +"پیشفرض تعریف متغییر ها از نوع «غیر قابل تغییر» (immutable) است:" #: src/basic-syntax/variables.md:18 msgid "" "Due to type inference the `i32` is optional. We will gradually show the " "types less and less as the course progresses." msgstr "" +"به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره کمتر " +"و کمتر آن را نشان خواهیم داد." #: src/basic-syntax/type-inference.md:3 msgid "Rust will look at how the variable is _used_ to determine the type:" -msgstr "" +msgstr "زبان Rust برای تعیین نوع متغیر به نحوه استفاده از آن نگاه می‌کند:" #: src/basic-syntax/type-inference.md:27 msgid "" "This slide demonstrates how the Rust compiler infers types based on " "constraints given by variable declarations and usages." msgstr "" +"این اسلاید نشان می‌دهد که چگونه کامپایلر Rust با توجه به اعلان‌ها و استفاده‌های " +"متغیر، انواع را استنتاج می‌کند. " #: src/basic-syntax/type-inference.md:29 msgid "" @@ -4328,6 +4334,11 @@ msgid "" "of a type. The compiler does the job for us and helps us write more concise " "code." msgstr "" +"بسیار مهم است که تاکید کنیم متغیرهایی که به این صورت تعریف می‌شوند از «نوع " +"داده پویای `any`» نیستند که بتواند هر نوعی باشند. وقتی که ما از **تعیین تایپ " +"ضمنی** استفاده می‌کنیم در واقع مشابه زمانی هست که نوع داده را به صورت صریح " +"اعلام میکنیم و کد های ماشین آنها دقیقا یکسان هستند. فقط با استفاده از تعیین " +"تایپ ضمنی میتوانید کد ها رو به صورت مختصرتر بنویسیم. " #: src/basic-syntax/type-inference.md:33 msgid "" @@ -4335,6 +4346,9 @@ msgid "" "container without the code ever explicitly specifying the contained type, " "using `_` as a placeholder:" msgstr "" +"کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، در " +"یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به عنوان " +"یک جایگزین برای اعلام نوع داده: " #: src/basic-syntax/type-inference.md:48 msgid "" @@ -4344,10 +4358,15 @@ msgid "" "org/std/collections/struct.HashSet.html#impl-FromIterator%3CT%3E-for-" "HashSet%3CT,+S%3E) implements." msgstr "" +"[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." +"html#method.collect) به [`FromIterator`](https://doc.rust-lang.org/std/iter/" +"trait.FromIterator.html) متکی است که [`HashSet`](https://doc.rust-lang.org/" +"std/collections/struct.HashSet.html#impl-FromIterator%3CT%3E-for-HashSet%3CT," +"+S%3E) آن را پیاده‌سازی می‌کند." #: src/basic-syntax/static-and-const.md:1 msgid "Static and Constant Variables" -msgstr "" +msgstr "استاتیک ها و ثابت ها" #: src/basic-syntax/static-and-const.md:3 msgid "" @@ -4355,6 +4374,9 @@ msgid "" "scoped values that cannot be moved or reallocated during the execution of " "the program. " msgstr "" +"متغیرهای `ثابت` و `ایستاتیک` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال " +"(قابل دسترس در کل برنامه) هستند که نمی‌توانند در طول اجرای برنامه منتقل یا " +"دوباره تعریف شوند." #: src/basic-syntax/static-and-const.md:6 msgid "`const`" @@ -4365,18 +4387,25 @@ msgid "" "Constant variables are evaluated at compile time and their values are " "inlined wherever they are used:" msgstr "" +"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که " +"استفاده می شوند، درج می شوند:" #: src/basic-syntax/static-and-const.md:30 msgid "" "According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" "vs-static.html) these are inlined upon use." msgstr "" +"طبق [کتاب Rust RFC](https://rust-lang.github.io/rfcs/0246-const-vs-static." +"html)، این موارد هنگام استفاده درج می شوند." #: src/basic-syntax/static-and-const.md:32 msgid "" "Only functions marked `const` can be called at compile time to generate " "`const` values. `const` functions can however be called at runtime." msgstr "" +"فقط توابعی که با `const` علامت گذاری شده اند می توانند در زمان کامپایل برای " +"تولید مقادیر `const` فراخوانی شوند. با این حال، توابع `const` را می توان در " +"زمان اجرا فراخوانی کرد (بر خلاف تعریف متغییری ثابت)" #: src/basic-syntax/static-and-const.md:34 msgid "`static`" @@ -4387,6 +4416,8 @@ msgid "" "Static variables will live during the whole execution of the program, and " "therefore will not move:" msgstr "" +"متغیرهای ایستاتیک در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل " +"نمی‌شوند:" #: src/basic-syntax/static-and-const.md:38 msgid "" @@ -4408,6 +4439,11 @@ msgid "" "globally-scoped value does not have a reason to need object identity, " "`const` is generally preferred." msgstr "" +"همانطور که در [کتاب Rust RFC](https://rust-lang.github.io/rfcs/0246-const-vs-" +"static.html) ذکر شده، این موارد هنگام استفاده درج نمی شوند و دارای یک مکان " +"حافظه واقعی هستند. این برای کدهای ناایمن و `embedded` مفید است و متغیر در کل " +"اجرای برنامه زنده می ماند. هنگامی که یک مقدار با اسکوپ گلوبال نیاز نیست, " +"استفاده از `const` ترجیح داده می‌شود." #: src/basic-syntax/static-and-const.md:50 msgid "" @@ -4418,40 +4454,58 @@ msgid "" "access to them requires `unsafe` code. We will look at [mutable statics](../" "unsafe/mutable-static-variables.md) in the chapter on Unsafe Rust." msgstr "" +"از آنجایی که متغیرهای `static` از هر رشته‌ای (thread) قابل دسترسی هستند، باید " +"`Sync` باشند. تغییرپذیری داخلی از طریق یک [`Mutex`](https://doc.rust-lang." +"org/std/sync/struct.Mutex.html)، اتمی یا مشابه امکان پذیر است. البته که " +"داشتن متغییر های استاتیک قابل تغییر هم امکان پذیر هست اما برای این کار نیاز " +"به همگام سازی دستی دارند. بنابراین هر دسترسی به آنها نیاز به کد `unsafe` " +"دارد. ما در فصل Unsafe Rust به استاتیک های قابل تغییر [mutable statics](../" +"unsafe/mutable-static-variables.md) نگاه خواهیم کرد." #: src/basic-syntax/static-and-const.md:58 msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`." msgstr "" +"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` عمل می کند." #: src/basic-syntax/static-and-const.md:59 msgid "" "`static`, on the other hand, is much more similar to a `const` or mutable " "global variable in C++." msgstr "" +"از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در " +"`C++` هستند." #: src/basic-syntax/static-and-const.md:60 msgid "" "`static` provides object identity: an address in memory and state as " "required by types with interior mutability such as `Mutex`." msgstr "" +"`static` هویت شی را فراهم می‌کند: آدرسی در حافظه و حالتی که توسط انواع با " +"تغییرپذیری داخلی مانند `Mutex` را نیاز دارد." #: src/basic-syntax/static-and-const.md:61 msgid "" "It isn't super common that one would need a runtime evaluated constant, but " "it is helpful and safer than using a static." msgstr "" +"با اینکه خیلی رایج نیست که اگر کسی به یک یک مقدار ثابت که در زمان اجرا " +"ارزیابی می‌شود از `const` استفاده کند اما مفید تر و ایمن تر از استفاده " +"`static`ها هستند." #: src/basic-syntax/static-and-const.md:62 msgid "`thread_local` data can be created with the macro `std::thread_local`." msgstr "" +"داده‌های `thread_local` را با ماکروی `std::thread_local` " +"می‌توان ایجاد کرد." #: src/basic-syntax/static-and-const.md:64 msgid "Properties table:" -msgstr "" +msgstr "جدول خاصیت‌ها:" #: src/basic-syntax/static-and-const.md:66 msgid "Property" -msgstr "" +msgstr "ویژگی" #: src/basic-syntax/static-and-const.md:66 msgid "Static" @@ -4463,54 +4517,56 @@ msgstr "" #: src/basic-syntax/static-and-const.md:68 msgid "Has an address in memory" -msgstr "" +msgstr "دارای یک آدرس واقعی در حافظه" #: src/basic-syntax/static-and-const.md:68 #: src/basic-syntax/static-and-const.md:69 #: src/basic-syntax/static-and-const.md:71 #: src/basic-syntax/static-and-const.md:72 msgid "Yes" -msgstr "" +msgstr "بلی" #: src/basic-syntax/static-and-const.md:68 msgid "No (inlined)" -msgstr "" +msgstr "خیر (به صورت درون خطی)" #: src/basic-syntax/static-and-const.md:69 msgid "Lives for the entire duration of the program" -msgstr "" +msgstr "در طول‌عمر کل برنامه زنده می‌ماند؟" #: src/basic-syntax/static-and-const.md:69 #: src/basic-syntax/static-and-const.md:70 #: src/basic-syntax/static-and-const.md:72 msgid "No" -msgstr "" +msgstr "خیر" #: src/basic-syntax/static-and-const.md:70 msgid "Can be mutable" -msgstr "" +msgstr "میتوان قابل تغییر اش کرد" #: src/basic-syntax/static-and-const.md:70 msgid "Yes (unsafe)" -msgstr "" +msgstr "بلی (unsafe)" #: src/basic-syntax/static-and-const.md:71 msgid "Evaluated at compile time" -msgstr "" +msgstr "ارزیابی در زمان کامپایل" #: src/basic-syntax/static-and-const.md:71 msgid "Yes (initialised at compile time)" -msgstr "" +msgstr "بلی (در زمان کامپایل ساخته می‌شود)" #: src/basic-syntax/static-and-const.md:72 msgid "Inlined wherever it is used" -msgstr "" +msgstr "به صورت درون‌خطی هر جا که استفاده میشود قرار میگیرد" #: src/basic-syntax/scopes-shadowing.md:3 msgid "" "You can shadow variables, both those from outer scopes and variables from " "the same scope:" msgstr "" +"شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و " +"هم متغیرهایی که از اسکوپ یکسان هستند:" #: src/basic-syntax/scopes-shadowing.md:6 msgid "" @@ -4538,16 +4594,21 @@ msgid "" "both variable's memory locations exist at the same time. Both are available " "under the same name, depending where you use it in the code. " msgstr "" +"تعریف: سایه زدن با متغییر قابل تغییر متفاوت است، زیرا پس از سایه زدن، مکان " +"های حافظه هر دو متغیر همزمان وجود دارند. هر دو تحت یک نام در دسترس هستند، " +"بسته به اینکه در کجا در کد از آن استفاده می کنید." #: src/basic-syntax/scopes-shadowing.md:26 msgid "A shadowing variable can have a different type. " -msgstr "" +msgstr "یک متغیر سایه‌دار می تواند انواع داده‌ای متفاوتی داشته باشد." #: src/basic-syntax/scopes-shadowing.md:27 msgid "" "Shadowing looks obscure at first, but is convenient for holding on to values " "after `.unwrap()`." msgstr "" +"سایه زدن در ابتدا مبهم به نظر می رسد، اما برای نگه داشتن مقادیر پس از `.unwrap()` مناسب است." #: src/basic-syntax/scopes-shadowing.md:28 msgid "" @@ -4555,12 +4616,17 @@ msgid "" "locations when shadowing an immutable variable in a scope, even if the type " "does not change." msgstr "" +"کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه که " +"قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر غیر قابل " +"تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." #: src/enums.md:3 msgid "" "The `enum` keyword allows the creation of a type which has a few different " "variants:" msgstr "" +"کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف " +"است:" #: src/enums.md:6 msgid "" @@ -4594,26 +4660,32 @@ msgstr "" #: src/enums.md:36 msgid "Enumerations allow you to collect a set of values under one type" msgstr "" +"`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را " +"تحت یک نوع جمع آوری کنید." #: src/enums.md:37 msgid "" "This page offers an enum type `CoinFlip` with two variants `Heads` and " "`Tails`. You might note the namespace when using variants." msgstr "" +"در این صفحه نوع`Enum`به اسم `CoinFlip` که دارای `Heads` و `Tails` می‌باشد. " +"هنگام استفاده از `Enum`ها، به این اینگونه نام‌ها توجه کنید." #: src/enums.md:38 msgid "This might be a good time to compare Structs and Enums:" -msgstr "" +msgstr "الان زمان خوبی برای مقایسه ساختارها و `Enum`هاست:" #: src/enums.md:39 msgid "" "In both, you can have a simple version without fields (unit struct) or one " "with different types of fields (variant payloads). " msgstr "" +"در هر دو، می توانید یک نسخه ساده بدون فیلد (unit struct) یا یکی با انواع " +"مختلف فیلد (variant payloads) داشته باشید." #: src/enums.md:40 msgid "In both, associated functions are defined within an `impl` block." -msgstr "" +msgstr "در هر دو، توابع مورد نیازشون در داخل یک بلاک `impl` تعریف می‌شوند." #: src/enums.md:41 msgid "" @@ -4621,12 +4693,17 @@ msgid "" "structs but then they wouldn’t be the same type as they would if they were " "all defined in an enum. " msgstr "" +"شما حتی می توانید انواع مختلف یک `Enum` را با ساختارهای جداگانه پیاده سازی " +"کنید، اما در آن صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` " +"نخواهند بود." #: src/enums/variant-payloads.md:3 msgid "" "You can define richer enums where the variants carry data. You can then use " "the `match` statement to extract the data from each variant:" msgstr "" +"می توانید شمارش های غنی تری را تعریف کنید که در آن انواع مختلف داده باشند. " +"سپس می‌توانید از دستور `match` برای استخراج داده‌ها از هر فیلد استفاده کنید:" #: src/enums/variant-payloads.md:6 msgid "" @@ -4664,46 +4741,64 @@ msgid "" "matched. The pattern binds references to the fields in the \"match arm\" " "after the `=>`." msgstr "" +"مقادیر در`Enum` فقط پس از طییق الگوی قابل دسترسی هستند. الگو ارجاعی را به " +"فیلدهای موجود با استفاده بازوی `match` پس از `=>` " +"متصل می کند." #: src/enums/variant-payloads.md:36 msgid "" "The expression is matched against the patterns from top to bottom. There is " "no fall-through like in C or C++." msgstr "" +"بر خلاف زبان‌های برخلاف C یا `C++` طبیق الگو به صورت از " +"بالا به پایین نمی‌باشد." #: src/enums/variant-payloads.md:37 msgid "" "The match expression has a value. The value is the last expression in the " "match arm which was executed." msgstr "" +"عبارت `match` دارای یک مقدار بازگشتی است. این مقدار آخرین عبارت در بازوی " +"`match` ای است که اجرا شده است." #: src/enums/variant-payloads.md:38 msgid "" "Starting from the top we look for what pattern matches the value then run " "the code following the arrow. Once we find a match, we stop. " msgstr "" +"از بالا شروع می‌کنیم و به دنبال الگویی هستیم که با مقدار مطابقت داشته باشد، " +"سپس کد پس از `=>` را اجرا می‌کنیم. بعد از اینکه توی " +"match اولین طبیق الگو انجام شد جستجو متوقف میشود." #: src/enums/variant-payloads.md:39 msgid "" "Demonstrate what happens when the search is inexhaustive. Note the advantage " "the Rust compiler provides by confirming when all cases are handled. " msgstr "" +"این اتفاق را زمانی که الگوهای جستجو کامل نیستند نشان دهید. به مزیت کامپایلر " +"Rust که با تایید زمانی که همه موارد رسیدگی می‌شوند، اشاره کنید." #: src/enums/variant-payloads.md:40 msgid "`match` inspects a hidden discriminant field in the `enum`." msgstr "" +"دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` را " +"بررسی می کند." #: src/enums/variant-payloads.md:41 msgid "" "It is possible to retrieve the discriminant by calling `std::mem::" "discriminant()`" msgstr "" +"می توان با فراخوانی `std::mem::discriminant()` فیلد " +"تشخیصی پنهان را دریافت کرد." #: src/enums/variant-payloads.md:42 msgid "" "This is useful, for example, if implementing `PartialEq` for structs where " "comparing field values doesn't affect equality." msgstr "" +"بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. قابلیت " +"`PartialEq` بر برابری تأثیر نمی‌گذارد." #: src/enums/variant-payloads.md:43 msgid "" @@ -4711,6 +4806,10 @@ msgid "" "Click(Click)` with a top level `struct Click { ... }`. The inlined version " "cannot implement traits, for example." msgstr "" +"`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct Click " +"{ ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها را " +"پیاده‌سازی کند." #: src/enums/sizes.md:3 msgid "" From e26a463b74f8ae19c4f4de30017a58b7959571b1 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Tue, 7 Nov 2023 14:34:19 +0330 Subject: [PATCH 16/23] Add translation until `#: src/basic-syntax/variables.md:5` --- po/fa.po | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/po/fa.po b/po/fa.po index 2c671a0b187d..86a385ca62eb 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4816,6 +4816,8 @@ msgid "" "Rust enums are packed tightly, taking constraints due to alignment into " "account:" msgstr "" +"`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت " +"های ناشی از هم ترازی:" #: src/enums/sizes.md:5 msgid "" @@ -4844,17 +4846,23 @@ msgid "" "See the [Rust Reference](https://doc.rust-lang.org/reference/type-layout." "html)." msgstr "" +"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) " +"مراجعه کنید." #: src/enums/sizes.md:30 msgid "" "Internally Rust is using a field (discriminant) to keep track of the enum " "variant." msgstr "" +"زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع فیلدهای " +"`enum` استفاده می کند." #: src/enums/sizes.md:32 msgid "" "You can control the discriminant if needed (e.g., for compatibility with C):" msgstr "" +"شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant " +"را کنترل کنید:" #: src/enums/sizes.md:50 msgid "" From 5bab11cbbab49c20246ca53d36df78721676d6e4 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Tue, 7 Nov 2023 17:19:30 +0330 Subject: [PATCH 17/23] Add translation until `#: src/pattern-matching/destructuring-enums.md:3` --- po/fa.po | 109 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 97 insertions(+), 12 deletions(-) diff --git a/po/fa.po b/po/fa.po index 86a385ca62eb..2095a2e84fb0 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4869,46 +4869,62 @@ msgid "" "Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 " "bytes." msgstr "" +"بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 " +"بایت جا می‌شود." #: src/enums/sizes.md:54 msgid "Try out other types such as" -msgstr "" +msgstr "سایر انواع‌داده را امتحان کنید، مانند:" #: src/enums/sizes.md:56 msgid "`dbg_size!(bool)`: size 1 bytes, align: 1 bytes," msgstr "" +"dbg_size!(bool): اندازه توی " +"حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," #: src/enums/sizes.md:57 msgid "" "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche optimization, " "see below)," msgstr "" +"dbg_size!(Option): " +"اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است " +"(بهینه‌سازی خاص، در زیر ببینید)" #: src/enums/sizes.md:58 msgid "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," msgstr "" +"dbg_size!(&i32): اندازه توی " +"حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ بیتی)" #: src/enums/sizes.md:59 msgid "" "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer " "optimization, see below)." msgstr "" +"dbg_size!(Option<&i32>): اندازه " +"توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (بهینه‌سازی " +"اشاره‌گر NULL را در زیر ببینید)" #: src/enums/sizes.md:61 src/memory-management/stack.md:32 msgid "More to Explore" -msgstr "" +msgstr "برای کاوش بیشتر" #: src/enums/sizes.md:63 msgid "" "Rust has several optimizations it can employ to make enums take up less " "space." msgstr "" +"زبان Rust دارای چندین بهینه‌سازی دارد که می‌تواند برای کاهش فضای اشغال شده " +"توسط`Enum`ها استفاده کند." #: src/enums/sizes.md:65 msgid "" "Niche optimization: Rust will merge unused bit patterns for the enum " "discriminant." msgstr "" +"بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع " +"`Enum` ادغام می‌کند." #: src/enums/sizes.md:68 msgid "" @@ -4916,6 +4932,9 @@ msgid "" "option/#representation), Rust guarantees that `size_of::()` equals " "`size_of::>()`." msgstr "" +"بهینه‌سازی اشاره‌گر `NULL`: برای برخی از انواع، Rust تضمین می‌کند که `size_of::()` برابر با `size_of::" +">()` است." #: src/enums/sizes.md:72 msgid "" @@ -4923,12 +4942,17 @@ msgid "" "like in practice. It's important to note that the compiler provides no " "guarantees regarding this representation, therefore this is totally unsafe." msgstr "" +"کد نمونه, اگر می‌خواهید نشان دهید که نمایش بیت به بیت در عمل چگونه ممکن است " +"به نظر برسد. مهم است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این " +"نمایش نمی‌دهد، بنابراین این کاملاً ناایمن است." #: src/enums/sizes.md:109 msgid "" "More complex example if you want to discuss what happens when we chain more " "than 256 `Option`s together." msgstr "" +"مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ عدد " +"`Option` را به صورت تو در تو صدا بزنیم بحث کنید." #: src/control-flow/novel.md:3 msgid "" @@ -4938,16 +4962,15 @@ msgstr "" #: src/control-flow/novel.md:6 src/control-flow/if-let-expressions.md:1 msgid "`if let` expressions" -msgstr "" +msgstr "عبارت `if let`" #: src/control-flow/novel.md:7 -#, fuzzy msgid "`while let` expressions" -msgstr "عبارت while let" +msgstr "عبارت `while let`" #: src/control-flow/novel.md:8 src/control-flow/match-expressions.md:1 msgid "`match` expressions" -msgstr "" +msgstr "عبارت `match`" #: src/control-flow/if-let-expressions.md:3 msgid "" @@ -4955,6 +4978,9 @@ msgid "" "expr.html#if-let-expressions) lets you execute different code depending on " "whether a value matches a pattern:" msgstr "" +"[عبارت `if let`](https://doc.rust-lang.org/reference/expressions/if-expr." +"html#if-let-expressions) به شما امکان می‌دهد بسته به اینکه آیا یک مقدار با " +"یک الگو مطابقت دارد، کدهای مختلفی را اجرا کنید:" #: src/control-flow/if-let-expressions.md:7 msgid "" @@ -4977,21 +5003,30 @@ msgid "" "See [pattern matching](../pattern-matching.md) for more details on patterns " "in Rust." msgstr "" +"به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " +"Rust اطلاعات بیشتری کسب کنید." #: src/control-flow/if-let-expressions.md:23 msgid "" "Unlike `match`, `if let` does not have to cover all branches. This can make " "it more concise than `match`." msgstr "" +"برخلاف دستور `match` دستور `if let` همه حالت های ممکن را برای تطبیق الگو " +"پشتیبانی نمیکند. اگر می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده " +"کنید." #: src/control-flow/if-let-expressions.md:24 msgid "A common usage is handling `Some` values when working with `Option`." msgstr "" +"یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با " +"`Option` است:" #: src/control-flow/if-let-expressions.md:25 msgid "" "Unlike `match`, `if let` does not support guard clauses for pattern matching." msgstr "" +"برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق " +"الگو استفاده نمیکند." #: src/control-flow/if-let-expressions.md:26 msgid "" @@ -5000,10 +5035,14 @@ msgid "" "assignment, or if it fails, execute a block which is required to abort " "normal control flow (with `panic`/`return`/`break`/`continue`):" msgstr "" +"از نسخه 1.65، یک کلیدواژه مشابه به اسم [`let-else`](https://doc.rust-lang." +"org/rust-by-example/flow_control/let_else.html) اجازه می‌دهد تا یک انتساب به " +"صورت destructuring انجام شود، یا اگر شکست خورد، یک بلوک را اجرا کند که برای " +"خاتمه دادن به جریان کنترل عادی (با panic/return/break/continue) ضروری است:" #: src/control-flow/while-let-expressions.md:1 msgid "`while let` loops" -msgstr "" +msgstr "حلقه `while let`" #: src/control-flow/while-let-expressions.md:3 msgid "" @@ -5011,6 +5050,9 @@ msgid "" "reference/expressions/loop-expr.html#predicate-pattern-loops) variant which " "repeatedly tests a value against a pattern:" msgstr "" +"مانند `if let`، یک دستور [`while let`](https://doc.rust-lang.org/reference/" +"expressions/loop-expr.html#predicate-pattern-loops) وجود دارد که مقادیر " +"مقابل الگو به طور مکرر (تکرار شونده‌ای) بررسی می‌کند:" #: src/control-flow/while-let-expressions.md:18 msgid "" @@ -5019,12 +5061,20 @@ msgid "" "it will return `None`. The `while let` lets us keep iterating through all " "items." msgstr "" +"در اینجا، پیماینده (iterator) توسط `v.into_iter()` یک " +"مقدار را برمیگرداند, یک `Option` را در هر فراخوانی " +"به `next()` برمی گرداند. تا زمانی که محتوایی وجود داشته " +"باشد این کار ادامه پیدا میکند و وقتی که تمام شد `Some(x)` را برمی گرداند و پس از آن None را برمی گرداند. `while let` به ما امکان " +"می دهد همه مارد را به صورت کامل پیمایش کنیم." #: src/control-flow/while-let-expressions.md:27 msgid "" "Point out that the `while let` loop will keep going as long as the value " "matches the pattern." msgstr "" +"توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق " +"داشته باشد (شرط برقرار باشد)، ادامه خواهد داشت." #: src/control-flow/while-let-expressions.md:28 msgid "" @@ -5032,6 +5082,10 @@ msgid "" "statement that breaks when there is no value to unwrap for `iter.next()`. " "The `while let` provides syntactic sugar for the above scenario." msgstr "" +"می‌توانید حلقه `while let` را به عنوان یک حلقه بی‌پایان با یک عبارت `if` " +"بازنویسی کنید که زمانی که مقداری برای باز کردن `iter.next()` وجود ندارد، قطع می‌شود. `while let` مثل آب خوردن سناریو بالا رو برای " +"شما فراهم می‌کند." #: src/control-flow/match-expressions.md:3 msgid "" @@ -5039,6 +5093,9 @@ msgid "" "expr.html) is used to match a value against one or more patterns. In that " "sense, it works like a series of `if let` expressions:" msgstr "" +"[کلمه‌کلیدی `match`](https://doc.rust-lang.org/reference/expressions/match-" +"expr.html) برای مطابقت یک مقدار در برابر یک یا چند الگو استفاده می‌شود. از " +"این نظر، مانند یک سری عبارات `if let` عمل می‌کند:" #: src/control-flow/match-expressions.md:7 msgid "" @@ -5061,41 +5118,61 @@ msgid "" "Like `if let`, each match arm must have the same type. The type is the last " "expression of the block, if any. In the example above, the type is `()`." msgstr "" +"مثل دستور `if let`، باید همه شاخه تطبیق باید از نوع یکسانی را داشته باشند. " +"نوع عبارت در آخر بلوک تعیین می‌شود، البته اگر وجود داشته باشد. در مثال بالا، " +"نوع `()` است." #: src/control-flow/match-expressions.md:28 msgid "Save the match expression to a variable and print it out." msgstr "" +"مقادر بازگشتی از دستور `match` را در متغییری ذخیره کنید و آن را چاپ کنید." #: src/control-flow/match-expressions.md:29 msgid "Remove `.as_deref()` and explain the error." msgstr "" +".as_deref() را حذف کنید و خطا " +"را توضیح دهید." #: src/control-flow/match-expressions.md:30 msgid "" "`std::env::args().next()` returns an `Option`, but we cannot match " "against `String`." msgstr "" +"std::env::args().next() یک " +"`Option` را برمی‌گرداند،چرا نمی توانیم به عنوان " +"`String` تطبیق الگو کنیم؟" #: src/control-flow/match-expressions.md:31 msgid "" "`as_deref()` transforms an `Option` to `Option<&T::Target>`. In our case, " "this turns `Option` into `Option<&str>`." msgstr "" +"as_deref() یک `Option` را به `Option<&T::Target>` " +"تبدیل می‌کند. در مورد ما، این `Option` را به " +"`Option<&str>` تبدیل می‌کند." #: src/control-flow/match-expressions.md:32 msgid "" "We can now use pattern matching to match against the `&str` inside `Option`." msgstr "" +"اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` داخل " +"`Option` استفاده کنیم." #: src/pattern-matching.md:3 msgid "" "The `match` keyword lets you match a value against one or more _patterns_. " "The comparisons are done from top to bottom and the first match wins." msgstr "" +"کلمه کلیدی `match` به شما امکان می دهد یک مقدار را در برابر _یک یا چند الگو_ " +"مطابقت دهید. مقایسه‌ها از بالا به پایین انجام می‌شوند و اولین تطبیق انتخاب " +"می‌شود." #: src/pattern-matching.md:6 msgid "The patterns can be simple values, similarly to `switch` in C and C++:" msgstr "" +"الگوها می توانند مقادیر ساده ای باشند، شبیه به `switch` در C و C++:" #: src/pattern-matching.md:8 msgid "" @@ -5115,45 +5192,53 @@ msgstr "" #: src/pattern-matching.md:21 msgid "The `_` pattern is a wildcard pattern which matches any value." -msgstr "" +msgstr "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." #: src/pattern-matching.md:26 msgid "" "You might point out how some specific characters are being used when in a " "pattern" msgstr "" +"بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" #: src/pattern-matching.md:27 msgid "`|` as an `or`" -msgstr "" +msgstr "`|` به عنوان `or`" #: src/pattern-matching.md:28 msgid "`..` can expand as much as it needs to be" -msgstr "" +msgstr "`..` برای تعیین همه محدوده یا تا جایی که میتوان گسترش یابد" #: src/pattern-matching.md:29 msgid "`1..=5` represents an inclusive range" msgstr "" +"1..=5 نمایانگر یک محدوده خاص " +"است." #: src/pattern-matching.md:30 msgid "`_` is a wild card" -msgstr "" +msgstr "`_` یک wildcard (هر حالتی) است." #: src/pattern-matching.md:31 msgid "" "It can be useful to show how binding works, by for instance replacing a " "wildcard character with a variable, or removing the quotes around `q`." msgstr "" +"می‌توان با جایگزینی یک کاراکتر`_` با یک متغیر، یا حذف نقل قول ها در اطراف " +"`q`، به نمایش نحوه کارکرد انتساب کمک کرد." #: src/pattern-matching.md:32 msgid "You can demonstrate matching on a reference." -msgstr "" +msgstr "می‌توانید تطبیق الگو را با یک ارجاع را نشان دهید." #: src/pattern-matching.md:33 msgid "" "This might be a good time to bring up the concept of irrefutable patterns, " "as the term can show up in error messages." msgstr "" +"این ممکن است زمان خوبی برای مطرح کردن مفهوم الگوهای غیرقابل انکار " +"(irrefutable patterns) باشد، زیرا این اصطلاح می تواند در پیام های خطا ظاهر " +"شود." #: src/pattern-matching/destructuring-enums.md:3 msgid "" From a96ffbeb7bb5fabc0ab4c9f8a3916ec37fd31486 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Tue, 7 Nov 2023 17:45:14 +0330 Subject: [PATCH 18/23] Add translation until `#: src/exercises/day-1/afternoon.md:1` --- po/fa.po | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/po/fa.po b/po/fa.po index 2095a2e84fb0..21d13764da2f 100644 --- a/po/fa.po +++ b/po/fa.po @@ -5246,6 +5246,9 @@ msgid "" "how you inspect the structure of your types. Let us start with a simple " "`enum` type:" msgstr "" +"الگوها همچنین می توانند برای انتساب متغیرها استفاده شوند.به این ترتیب ساختار " +"انواع (Types) خود را بررسی می‌کنید. اجازه دهید با یک نوع `enum` ساده شروع " +"کنیم:" #: src/pattern-matching/destructuring-enums.md:6 msgid "" @@ -5279,12 +5282,16 @@ msgid "" "arm, `half` is bound to the value inside the `Ok` variant. In the second " "arm, `msg` is bound to the error message." msgstr "" +"در اینجا ما از شاخه‌ها برای `destructure` کردن مقدار `Result` استفاده " +"کرده‌ایم. در شاخه اول، `half` به مقداری داخل نوع `Ok` متصل می شود. در شاخه " +"دوم، `msg` به نوع`Err` متصل می‌شود." #: src/pattern-matching/destructuring-enums.md:36 msgid "" "The `if`/`else` expression is returning an enum that is later unpacked with " "a `match`." msgstr "" +"عبارت `if`/`else` یک `enum` را برمی گرداند که بعداً با `match` باز می شود." #: src/pattern-matching/destructuring-enums.md:37 msgid "" @@ -5292,10 +5299,13 @@ msgid "" "errors when running the code. Point out the places where your code is now " "inexhaustive and how the compiler tries to give you hints." msgstr "" +"می توانید با اضافه کردن یک فیلد دیگر `None` به `enum` اضافه کنید و نمایش " +"خطاها هنگام اجرای کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و " +"نحوه تلاش کامپایلر برای ارائه نکاتی به شما را نشان دهید." #: src/pattern-matching/destructuring-structs.md:3 msgid "You can also destructure `structs`:" -msgstr "" +msgstr "همچنین می‌توانید `structs` را destructure کنید:" #: src/pattern-matching/destructuring-structs.md:5 msgid "" @@ -5320,11 +5330,11 @@ msgstr "" #: src/pattern-matching/destructuring-structs.md:23 msgid "Change the literal values in `foo` to match with the other patterns." -msgstr "" +msgstr "تغییر مقادیر لیترال در foo برای مطابقت با سایر الگوها." #: src/pattern-matching/destructuring-structs.md:24 msgid "Add a new field to `Foo` and make changes to the pattern as needed." -msgstr "" +msgstr "اضافه کردن یک فیلد جدید به Foo و ایجاد تغییرات مورد نیاز." #: src/pattern-matching/destructuring-structs.md:25 msgid "" @@ -5332,11 +5342,15 @@ msgid "" "spot. Try changing the `2` in the second arm to a variable, and see that it " "subtly doesn't work. Change it to a `const` and see it working again." msgstr "" +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید " +"‍`2` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " +"به یک `const` تغییر دهید و خواهید دید که دوباره کار می‌کند." #: src/pattern-matching/destructuring-arrays.md:3 msgid "" "You can destructure arrays, tuples, and slices by matching on their elements:" msgstr "" +"می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure کنید." #: src/pattern-matching/destructuring-arrays.md:5 msgid "" @@ -5359,6 +5373,8 @@ msgid "" "Destructuring of slices of unknown length also works with patterns of fixed " "length." msgstr "" +"برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت کار " +"می کند." #: src/pattern-matching/destructuring-arrays.md:24 msgid "" @@ -5382,27 +5398,33 @@ msgstr "" #: src/pattern-matching/destructuring-arrays.md:41 msgid "Create a new pattern using `_` to represent an element. " -msgstr "" +msgstr "یک الگوی جدید با استفاده از `_` برای نمایش یک عنصر ایجاد کنید." #: src/pattern-matching/destructuring-arrays.md:42 msgid "Add more values to the array." -msgstr "" +msgstr "مقادیر بیشتری را به آرایه اضافه کنید." #: src/pattern-matching/destructuring-arrays.md:43 msgid "" "Point out that how `..` will expand to account for different number of " "elements." msgstr "" +"اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد " +"یافت." #: src/pattern-matching/destructuring-arrays.md:44 msgid "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" msgstr "" +"مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و " +"`[a@..,b]` را نشان دهید." #: src/pattern-matching/match-guards.md:3 msgid "" "When matching, you can add a _guard_ to a pattern. This is an arbitrary " "Boolean expression which will be executed if the pattern matches:" msgstr "" +"هنگام تطابق، می توانید یک _guard_ به یک الگو اضافه کنید. این یک عبارت بولین " +"دلخواه است که در صورت مطابقت الگو اجرا می شود." #: src/pattern-matching/match-guards.md:6 msgid "" @@ -5427,6 +5449,8 @@ msgid "" "we wish to concisely express more complex ideas than patterns alone would " "allow." msgstr "" +"گارد های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم " +"و ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." #: src/pattern-matching/match-guards.md:24 msgid "" @@ -5435,16 +5459,21 @@ msgid "" "match arm is selected. Failing the `if` condition inside of that block won't " "result in other arms of the original `match` expression being considered." msgstr "" +"آنها با عبارت `if` جداگانه ای در داخل یک شاخه تطبیق هستند یکسان نیستند. یک " +"عبارت `if` در داخل بلاک شاخه (پس از `=>`) پس از ورود به " +"اون شاخه خاص صدا زده میشود. اگر شرط `if` برقرار نباشد کاری به سایر شاخه های " +"عبارت `match` اصلی ندارد." #: src/pattern-matching/match-guards.md:26 msgid "You can use the variables defined in the pattern in your if expression." msgstr "" +"می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." #: src/pattern-matching/match-guards.md:27 msgid "" "The condition defined in the guard applies to every expression in a pattern " "with an `|`." -msgstr "" +msgstr "شرط تعریف شده در guard با کمک `|` به شرط های تطبیق الگو اضافه می‌شود." #: src/exercises/day-1/afternoon.md:1 msgid "Day 1: Afternoon Exercises" From ac1d2cc4b8ee349fc93243a7a755da0bc2c21bac Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Wed, 8 Nov 2023 12:15:36 +0330 Subject: [PATCH 19/23] Add translation until `#: src/ownership/borrowing.md:3` --- po/fa.po | 272 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 208 insertions(+), 64 deletions(-) diff --git a/po/fa.po b/po/fa.po index 21d13764da2f..2d2957e390d9 100644 --- a/po/fa.po +++ b/po/fa.po @@ -299,7 +299,7 @@ msgstr "های جابجا شده در Rust String" #: src/SUMMARY.md:92 msgid "Double Frees in Modern C++" -msgstr "آزاد سازی مضاعف درC++ مدرن" +msgstr "آزاد سازی مضاعف در سی‌پلاس‌پلاس مدرن" #: src/SUMMARY.md:93 src/ownership/moves-function-calls.md:1 msgid "Moves in Function Calls" @@ -5477,20 +5477,19 @@ msgstr "شرط تعریف شده در guard با کمک `|` به شرط های #: src/exercises/day-1/afternoon.md:1 msgid "Day 1: Afternoon Exercises" -msgstr "" +msgstr "روز ۱: تمرین‌های عصر" #: src/exercises/day-1/afternoon.md:3 msgid "We will look at two things:" -msgstr "" +msgstr "ما روی ۲ تا چیز نگاهی می‌اندازیم:" #: src/exercises/day-1/afternoon.md:5 -#, fuzzy msgid "The Luhn algorithm," msgstr "الگوریتم Luhn" #: src/exercises/day-1/afternoon.md:7 msgid "An exercise on pattern matching." -msgstr "" +msgstr "تمرینی درباره تطبیق الگو" #: src/exercises/day-1/afternoon.md:11 src/exercises/day-2/afternoon.md:7 #: src/exercises/bare-metal/afternoon.md:7 @@ -5499,6 +5498,8 @@ msgid "" "After looking at the exercises, you can look at the [solutions](solutions-" "afternoon.md) provided." msgstr "" +"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه " +"شده نگاهی بیندازید." #: src/exercises/day-1/luhn.md:3 msgid "" @@ -5506,42 +5507,56 @@ msgid "" "to validate credit card numbers. The algorithm takes a string as input and " "does the following to validate the credit card number:" msgstr "" +"[الگوریتم Luhn](https://en.wikipedia.org/wiki/Luhn_algorithm) برای " +"اعتبارسنجی شماره‌های کارت اعتباری استفاده می‌شود. این الگوریتم یک رشته را به " +"عنوان ورودی دریافت می‌کند و برای اعتبارسنجی شماره کارت اعتباری مراحل زیر را " +"انجام می‌دهد:" #: src/exercises/day-1/luhn.md:7 msgid "Ignore all spaces. Reject number with less than two digits." -msgstr "" +msgstr "تمام فضاها را نادیده بگیرید.شماره‌هایی با کمتر از دو رقم را رد کنید." #: src/exercises/day-1/luhn.md:9 msgid "" "Moving from **right to left**, double every second digit: for the number " "`1234`, we double `3` and `1`. For the number `98765`, we double `6` and `8`." msgstr "" +"با حرکت از سمت راست رشته به چپ، هر دومین رقم را دوبل کنید: برای شماره " +"`1234`، `3` و `1` را دوبل می‌کنیم. برای شماره `98765`، `6` و `8` را دوبل " +"می‌کنیم." #: src/exercises/day-1/luhn.md:12 msgid "" "After doubling a digit, sum the digits if the result is greater than 9. So " "doubling `7` becomes `14` which becomes `1 + 4 = 5`." msgstr "" +"پس از دوبل کردن یک عدد، اگر اون جفت خروجی بیش از 9 باشد، ارقام را جمع کنید. " +"بنابراین، دوبل کردن `7` به `14` تبدیل می‌شود که به `1 + 4 = 5` تبدیل می‌شود." #: src/exercises/day-1/luhn.md:15 msgid "Sum all the undoubled and doubled digits." -msgstr "" +msgstr "تمام ارقام دو برابر نشده و دو برابر شده را جمع کنید." #: src/exercises/day-1/luhn.md:17 msgid "The credit card number is valid if the sum ends with `0`." -msgstr "" +msgstr "اگر مجموع با ‍`0` خاتمه یابد، شماره کارت اعتباری معتبر است." #: src/exercises/day-1/luhn.md:19 msgid "" "Copy the code below to and implement the " "function." msgstr "" +"کد زیر را به کپی کنید و " +"تابع را پیاده‌سازی کنید." #: src/exercises/day-1/luhn.md:21 msgid "" "Try to solve the problem the \"simple\" way first, using `for` loops and " "integers. Then, revisit the solution and try to implement it with iterators." msgstr "" +"ابتدا سعی کنید مشکل را به روش «ساده» با استفاده از حلقه‌های `for` و اعداد " +"صحیح حل کنید. سپس، سعی کنید آن را با استفاده از `iterator`ها پیاده‌سازی کنید." #: src/exercises/day-1/luhn.md:25 msgid "" @@ -5598,11 +5613,11 @@ msgstr "" #: src/exercises/day-1/pattern-matching.md:1 msgid "Exercise: Expression Evaluation" -msgstr "" +msgstr "تمرین: عبارت را بسنجید" #: src/exercises/day-1/pattern-matching.md:3 msgid "Let's write a simple recursive evaluator for arithmetic expressions. " -msgstr "" +msgstr "بیایید یک ارزیاب بازگشتی ساده برای عبارات حسابی بنویسیم." #: src/exercises/day-1/pattern-matching.md:5 msgid "" @@ -5709,6 +5724,11 @@ msgid "" "tests. To evaluate a boxed expression, use the deref operator to \"unbox\" " "it: `eval(*boxed_expr)`." msgstr "" +"نوع `Box` در اینجا یک اشاره گر هوشمند است و در ادامه دوره به طور مفصل مورد " +"بحث قرار خواهد گرفت. یک عبارت را می‌توان با `Box::new` " +"مانند آنچه در تست‌ها دیده می‌شود، «جعبه‌ای» کرد. برای ارزیابی یک عبارت جعبه‌ای، " +"از عملگر `deref` برای «خارج کردن» آن استفاده کنید: `eval(*boxed_expr)`" #: src/exercises/day-1/pattern-matching.md:105 msgid "" @@ -5716,6 +5736,9 @@ msgid "" "type represents either a successful value or an error with a message. This " "is very similar to the standard-library `Result` which we will see later." msgstr "" +"برخی از عبارات قابل ارزیابی نیستند و خطایی را برمی‌گردانند. نوع `Res` " +"نشان‌دهنده یک مقدار موفقیت‌آمیز یا یک خطا با پیام است. این بسیار شبیه به " +"`Result` کتابخانه استاندارد است که بعداً خواهیم دید." #: src/exercises/day-1/pattern-matching.md:109 msgid "" @@ -5723,28 +5746,36 @@ msgid "" "`eval`. The final product should pass the tests. It may be helpful to use " "`todo!()` and get the tests to pass one-by-one." msgstr "" +"کد را کپی و در زمین بازی Rust پیست کنید و شروع به پیاده‌سازی `eval` کنید. " +"محصول نهایی باید تست‌ها را پشت سر بگذارد. ممکن است مفید باشد از `todo!()` استفاده کنید و تست‌ها را یکی یکی پاس دهید." #: src/exercises/day-1/pattern-matching.md:113 msgid "" "If you finish early, try writing a test that results in an integer overflow. " "How could you handle this with `Res::Err` instead of a panic?" msgstr "" +"اگر زود تموم شد، سعی کنید تست‌ای بنویسید که منجر به سرریز عدد صحیح (integer " +"overflow) شود. چگونه می توانید این مشکل را با `Res::Err` به جای `panic` برطرف کنید؟" #: src/welcome-day-2.md:1 msgid "Welcome to Day 2" -msgstr "" +msgstr "به روز دوم خوش آمدید" #: src/welcome-day-2.md:3 msgid "Now that we have seen a fair amount of Rust, we will continue with:" msgstr "" +"حالا که از زبان راست به اندازه کافی چیز های مختلفی دیده ایم وقت ادامه با " +"توجه به موارد زیر " #: src/welcome-day-2.md:5 msgid "" "Memory management: stack vs heap, manual memory management, scope-based " "memory management, and garbage collection." msgstr "" -"Memory management: stack vs heap, manual memory management, scope-based " -"memory management, و garbage collection." +"مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، مدیریت " +"حافظه مبتنی بر اسکوپ و جمع آوری زباله. " #: src/welcome-day-2.md:8 msgid "" @@ -5752,101 +5783,112 @@ msgid "" msgstr "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." #: src/welcome-day-2.md:10 -#, fuzzy msgid "Structs and methods." -msgstr "رشته‌ها و تکرارکننده‌ها (Strings and Iterators)" +msgstr "ساختارها و متدها." #: src/welcome-day-2.md:12 msgid "" "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, " "`Rc` and `Arc`." msgstr "" +"کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, `Rc` و " +"`Arc`." #: src/welcome-day-2.md:15 msgid "Modules: visibility, paths, and filesystem hierarchy." -msgstr "" +msgstr "ماژول‌ها: قابل دیدن بودن, مسیرها و مدیریت سلسله مراتبی فایل‌سیستم" #: src/memory-management.md:3 msgid "Traditionally, languages have fallen into two broad categories:" -msgstr "" +msgstr "به طور سنتی، زبان‌ها به دو دسته کلی تقسیم می شوند:" #: src/memory-management.md:5 msgid "Full control via manual memory management: C, C++, Pascal, ..." msgstr "" +"کنترل کامل از طریق مدیریت دستی حافظه: C، C++ ، " +"پاسکال، ..." #: src/memory-management.md:6 msgid "" "Full safety via automatic memory management at runtime: Java, Python, Go, " "Haskell, ..." msgstr "" +"ایمنی کامل از طریق مدیریت حافظه خودکار در زمان اجرا: جاوا، پایتون، Go، " +"Haskell، ..." #: src/memory-management.md:8 msgid "Rust offers a new mix:" -msgstr "" +msgstr "زبان Rust یک ترکیبی از هر را ارائه میدهد:" #: src/memory-management.md:10 msgid "" "Full control _and_ safety via compile time enforcement of correct memory " "management." -msgstr "" +msgstr "مدیریت کامل و ایمنی حافظه با مدیریت درست حافظه در زمان کامپایل" #: src/memory-management.md:13 msgid "It does this with an explicit ownership concept." -msgstr "" +msgstr "این کار رو با کمک مفهوم مالکیت صریح انجام میدهد." #: src/memory-management.md:15 msgid "First, let's refresh how memory management works." -msgstr "" +msgstr "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." #: src/memory-management/stack-vs-heap.md:1 msgid "The Stack vs The Heap" -msgstr "" +msgstr "پشته (Stack) در مقابل انباشت (Heap)" #: src/memory-management/stack-vs-heap.md:3 msgid "Stack: Continuous area of memory for local variables." msgstr "" +"پشته: مقادیر پشت سر هم در حافظه که برای متغییر محلی (داخل یک تابع) استفاده " +"میشود." #: src/memory-management/stack-vs-heap.md:4 msgid "Values have fixed sizes known at compile time." msgstr "" +"مقادیر دارای سایز یکسان در طول کل پشته هستند که در زمان کامپایل تعیین می‌شود." #: src/memory-management/stack-vs-heap.md:5 msgid "Extremely fast: just move a stack pointer." -msgstr "" +msgstr "بسیار سریع: فقط کافیه یک اشاره‌گر را جا به جا کنیم." #: src/memory-management/stack-vs-heap.md:6 msgid "Easy to manage: follows function calls." -msgstr "" +msgstr "مدیریت آسان: از فراخوانی توابع پیروی میکنند." #: src/memory-management/stack-vs-heap.md:7 msgid "Great memory locality." -msgstr "" +msgstr "بهره‌وری عالی از حافظه" #: src/memory-management/stack-vs-heap.md:9 msgid "Heap: Storage of values outside of function calls." msgstr "" +"انباشت: حافظه از از مقادیر که خارج از جایی که فراخوانی میشود وجود دارد." #: src/memory-management/stack-vs-heap.md:10 msgid "Values have dynamic sizes determined at runtime." -msgstr "" +msgstr "مقادیر سایز‌های مختلفی دارند که در زمان اجرا تعیین می‌شوند." #: src/memory-management/stack-vs-heap.md:11 msgid "Slightly slower than the stack: some book-keeping needed." -msgstr "" +msgstr "به طور محسوسی کندتر از پشته است: نیاز به یک چی-کجاست دارد." #: src/memory-management/stack-vs-heap.md:12 msgid "No guarantee of memory locality." -msgstr "" +msgstr "هیچ تضمینی برای بهره‌وری بالا از حافظه ندارد" #: src/memory-management/stack.md:1 msgid "Stack and Heap Example" -msgstr "" +msgstr "یک مثال از پشته و انباشت" #: src/memory-management/stack.md:3 msgid "" "Creating a `String` puts fixed-sized metadata on the stack and dynamically " "sized data, the actual string, on the heap:" msgstr "" +"یک `String` بسازید که متادیتا با سایزثابت را روی استک قرار دهد و متن اصلی " +"سایزپویا را در انباشت قرار دهد." #: src/memory-management/stack.md:6 msgid "" @@ -5862,6 +5904,8 @@ msgid "" "Mention that a `String` is backed by a `Vec`, so it has a capacity and " "length and can grow if mutable via reallocation on the heap." msgstr "" +"اشاره کنید که یک `String` بر پایه `Vec` است، بنابراین دارای ظرفیت و طول است " +"و می تواند در صورت قابل تغییر بودن از طریق تخصیص مجدد در انباش بزرگتر کند." #: src/memory-management/stack.md:30 msgid "" @@ -5870,12 +5914,19 @@ msgid "" "struct.System.html) and custom allocators can be implemented using the " "[Allocator API](https://doc.rust-lang.org/std/alloc/index.html)" msgstr "" +"اگر دانشجویان در مورد آن بپرسند، می توانید اشاره کنید که حافظه زیربنایی " +"انباشت (heap) است که با استفاده از [System Allocator](https://doc.rust-lang." +"org/std/alloc/struct.System.html) تخصیص داده می شود و تخصیص‌دهنده‌های سفارشی " +"را می‌توان با استفاده از [Allocator API](https://doc.rust-lang.org/std/alloc/" +"index.html) اجرا کرد." #: src/memory-management/stack.md:34 msgid "" "We can inspect the memory layout with `unsafe` Rust. However, you should " "point out that this is rightfully unsafe!" msgstr "" +"می‌توان با استفاده از `unsafe` در زبان راست چیدمان حافظه را بررسی کنیم. البته " +"که به این موضوع که این کار خیلی ناایمن است هم اشاره کنید." #: src/memory-management/stack.md:37 msgid "" @@ -5899,21 +5950,24 @@ msgstr "" #: src/memory-management/manual.md:3 msgid "You allocate and deallocate heap memory yourself." -msgstr "" +msgstr "شما خودتان حافظه انباشت را تخصیص داده و تخصیص‌زدایی می‌کنید." #: src/memory-management/manual.md:5 msgid "" "If not done with care, this can lead to crashes, bugs, security " "vulnerabilities, and memory leaks." msgstr "" +"اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های " +"امنیتی و نشتی حافظه شود." #: src/memory-management/manual.md:7 msgid "C Example" -msgstr "" +msgstr "مثالی در زبان C" #: src/memory-management/manual.md:9 msgid "You must call `free` on every pointer you allocate with `malloc`:" msgstr "" +"باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی کنید:" #: src/memory-management/manual.md:11 msgid "" @@ -5935,11 +5989,16 @@ msgid "" "pointer twice, or accessing a freed pointer can lead to exploitable security " "vulnerabilities." msgstr "" +"اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، " +"حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. " +"بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد " +"شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." #: src/memory-management/scope-based.md:3 msgid "" "Constructors and destructors let you hook into the lifetime of an object." msgstr "" +"سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) شوید." #: src/memory-management/scope-based.md:5 msgid "" @@ -5947,16 +6006,21 @@ msgid "" "destroyed. The compiler guarantees that this happens, even if an exception " "is raised." msgstr "" +"با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، حافظه " +"را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک exception " +"ایجاد شود." #: src/memory-management/scope-based.md:9 msgid "" "This is often called _resource acquisition is initialization_ (RAII) and " "gives you smart pointers." msgstr "" +"این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده " +"می‌شود و به شما اشاره گرهای هوشمند می‌دهد." #: src/memory-management/scope-based.md:12 msgid "C++ Example" -msgstr "" +msgstr "مثالی در C++" #: src/memory-management/scope-based.md:14 msgid "" @@ -5972,47 +6036,55 @@ msgid "" "The `std::unique_ptr` object is allocated on the stack, and points to memory " "allocated on the heap." msgstr "" +"ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و به " +"حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." #: src/memory-management/scope-based.md:22 msgid "At the end of `say_hello`, the `std::unique_ptr` destructor will run." msgstr "" +"در پایان `say_hello`، تابع مخرب `std::unique_ptr` اجرا " +"می‌شود." #: src/memory-management/scope-based.md:23 msgid "The destructor frees the `Person` object it points to." -msgstr "" +msgstr "مخرب شیء `Person` را که به آن اشاره می‌کند، آزاد می‌کند." #: src/memory-management/scope-based.md:25 msgid "" "Special move constructors are used when passing ownership to a function:" msgstr "" +"هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" #: src/memory-management/garbage-collection.md:1 msgid "Automatic Memory Management" -msgstr "" +msgstr "مدیریت حافظه خودکار" #: src/memory-management/garbage-collection.md:3 msgid "" "An alternative to manual and scope-based memory management is automatic " "memory management:" msgstr "" +"یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار است:" #: src/memory-management/garbage-collection.md:6 msgid "The programmer never allocates or deallocates memory explicitly." -msgstr "" +msgstr "برنامه نویس هیچ وقت به صورت صریح حافظه را تخصیص یا آزاد نمیکند." #: src/memory-management/garbage-collection.md:7 msgid "" "A garbage collector finds unused memory and deallocates it for the " "programmer." msgstr "" +"یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس " +"تخصیص‌زدایی (آزاد) می‌کند." #: src/memory-management/garbage-collection.md:9 msgid "Java Example" -msgstr "" +msgstr "مثالی در Java" #: src/memory-management/garbage-collection.md:11 msgid "The `person` object is not deallocated after `sayHello` returns:" -msgstr "" +msgstr "شیء `person` پس از بازگشت `sayHello` تخصیص‌زدایی نمی‌شود:" #: src/memory-management/garbage-collection.md:13 msgid "" @@ -6025,29 +6097,33 @@ msgstr "" #: src/memory-management/rust.md:1 msgid "Memory Management in Rust" -msgstr "" +msgstr "مدیریت حافظه در Rust" #: src/memory-management/rust.md:3 msgid "Memory management in Rust is a mix:" -msgstr "" +msgstr "مدیریت حافظه در Rust ترکیبی از موارد زیر است:" #: src/memory-management/rust.md:5 msgid "Safe and correct like Java, but without a garbage collector." -msgstr "" +msgstr "ایمن و صحیح مانند جاوا، اما بدون جمع‌آوری زباله." #: src/memory-management/rust.md:6 msgid "Scope-based like C++, but the compiler enforces full adherence." msgstr "" +"مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را " +"رعایت می‌کند." #: src/memory-management/rust.md:7 msgid "" "A Rust user can choose the right abstraction for the situation, some even " "have no cost at runtime like C." msgstr "" +"کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب است، " +"برخی مانند C هزینه‌ای در زمان اجرا ندارند." #: src/memory-management/rust.md:9 msgid "Rust achieves this by modeling _ownership_ explicitly." -msgstr "" +msgstr "زبان Rust این کار را با مدل‌سازی صریح مالکیت انجام می‌دهد." #: src/memory-management/rust.md:13 msgid "" @@ -6059,35 +6135,46 @@ msgid "" "ownership and memory allocation via various means, and prevent the potential " "errors in C." msgstr "" +"اگر توی این مرحله از شما پرسیده شد که چطوری این کار انجام می‌شود, میتوانید به " +"این موضوع که زبان راست معمولاً توسط انواع `wrapper RAII` مانند [`Box`]" +"(https://doc.rust-lang.org/std/boxed/struct.Box.html), [`Vec`](https://doc." +"rust-lang.org/std/vec/struct.Vec.html), [`Rc`](https://doc.rust-lang.org/std/" +"rc/struct.Rc.html), یا [`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc." +"html) مدیریت را انجام میدهد. این‌ها مالکیت و تخصیص حافظه را از طریق روش‌های " +"مختلف دربرمی‌گیرند و از خطاهای بالقوه در C جلوگیری می‌کنند." #: src/memory-management/rust.md:15 msgid "" "You may be asked about destructors here, the [Drop](https://doc.rust-lang." "org/std/ops/trait.Drop.html) trait is the Rust equivalent." msgstr "" +"اگر درباره مخرب‌ها (destructors) از شما پرسیدند, مخرب ها معادل پیاده‌سازی " +"[Drop](https://doc.rust-lang.org/std/ops/trait.Drop.html) هستند." #: src/ownership.md:3 msgid "" "All variable bindings have a _scope_ where they are valid and it is an error " "to use a variable outside its scope:" msgstr "" +"همه انتساب متغیر دارای یک *اسکوپ* هستند که در آن معتبر هستند و استفاده از یک " +"متغیر خارج از اسکوپ آن خطا است." #: src/ownership.md:19 msgid "" "At the end of the scope, the variable is _dropped_ and the data is freed." -msgstr "" +msgstr "در پایان اسکوپ، متغیر حذف می‌شود و داده‌ها آزاد می‌شوند." #: src/ownership.md:20 msgid "A destructor can run here to free up resources." -msgstr "" +msgstr "یک مخرب می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." #: src/ownership.md:21 msgid "We say that the variable _owns_ the value." -msgstr "" +msgstr "ما می‌گوییم که متغیر *مالکیت* یک مقدار است." #: src/ownership/move-semantics.md:3 msgid "An assignment will transfer _ownership_ between variables:" -msgstr "" +msgstr "انتساب, *مالکیت* را بین متغیرها منتقل می‌کند:" #: src/ownership/move-semantics.md:5 msgid "" @@ -6103,25 +6190,30 @@ msgstr "" #: src/ownership/move-semantics.md:14 msgid "The assignment of `s1` to `s2` transfers ownership." -msgstr "" +msgstr "انتساب `s1`به `s2` مالکیت را منتقل می‌کند." #: src/ownership/move-semantics.md:15 msgid "When `s1` goes out of scope, nothing happens: it does not own anything." msgstr "" +"زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی " +"نیست." #: src/ownership/move-semantics.md:16 msgid "When `s2` goes out of scope, the string data is freed." -msgstr "" +msgstr "زمانی که دیگر در اسکوپ `s2` نیستیم, داده‌های رشته آزاد می‌شوند." #: src/ownership/move-semantics.md:17 msgid "There is always _exactly_ one variable binding which owns a value." -msgstr "" +msgstr "همیشه مالکیت یک مقدار را یک متغییر که بهش انتساب میدیم دارد" #: src/ownership/move-semantics.md:21 msgid "" "Mention that this is the opposite of the defaults in C++, which copies by " "value unless you use `std::move` (and the move constructor is defined!)." msgstr "" +"اشاره کنید که این رویه راست بر خلاف پیش‌فرض زبان C++ " +"است که در ان مقدار کپی میشود مگر که از `std::move` " +"استفاده کنیم ( تا یک مقدار را جا به جا کنیم!)" #: src/ownership/move-semantics.md:23 msgid "" @@ -6129,31 +6221,36 @@ msgid "" "to manipulate the data itself is a matter of optimization, and such copies " "are aggressively optimized away." msgstr "" +"این رویه فقط برای انتقال مالکیت است. اینکه آیا هیچ کد ماشینی برای دستکاری " +"خود داده‌ها تولید می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی " +"به‌طور تهاجمی (aggressively) بهینه‌سازی می‌شوند." #: src/ownership/move-semantics.md:25 msgid "" "Simple values (such as integers) can be marked `Copy` (see later slides)." msgstr "" +"مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را " +"ببینید)." #: src/ownership/move-semantics.md:27 msgid "In Rust, clones are explicit (by using `clone`)." -msgstr "" +msgstr "در Rust، کلون‌ها واضح بیان می‌شوند (با استفاده از `clone`)." #: src/ownership/moved-strings-rust.md:11 msgid "The heap data from `s1` is reused for `s2`." -msgstr "" +msgstr "داده‌های انباشت از `s1` دوباره برای `s2` استفاده می‌شود." #: src/ownership/moved-strings-rust.md:12 msgid "When `s1` goes out of scope, nothing happens (it has been moved from)." -msgstr "" +msgstr "وقتی از اسکوپ `s1` خارج می‌شویم، هیچ اتفاقی نمی‌افتد." #: src/ownership/moved-strings-rust.md:14 msgid "Before move to `s2`:" -msgstr "" +msgstr "قبل از انتقال به `s2` :" #: src/ownership/moved-strings-rust.md:31 msgid "After move to `s2`:" -msgstr "" +msgstr "بعد از انتقال به `s2` :" #: src/ownership/moved-strings-rust.md:33 msgid "" @@ -6180,13 +6277,12 @@ msgid "" msgstr "" #: src/ownership/double-free-modern-cpp.md:1 -#, fuzzy msgid "Defensive Copies in Modern C++" -msgstr "آزاد سازی مضاعف در مدرن سی++" +msgstr "کپی‌های تدافعی در C++ مدرن" #: src/ownership/double-free-modern-cpp.md:3 msgid "Modern C++ solves this differently:" -msgstr "" +msgstr "C++ مدرن این مشکل را به شیوه متفاوتی حل می‌کند:" #: src/ownership/double-free-modern-cpp.md:5 msgid "" @@ -6200,18 +6296,22 @@ msgstr "" msgid "" "The heap data from `s1` is duplicated and `s2` gets its own independent copy." msgstr "" +"داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که " +"این کپی به صورت مستقل است." #: src/ownership/double-free-modern-cpp.md:11 msgid "When `s1` and `s2` go out of scope, they each free their own memory." msgstr "" +"حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت " +"جداگانه‌ای حافظه خود را آزاد میکنند." #: src/ownership/double-free-modern-cpp.md:13 msgid "Before copy-assignment:" -msgstr "" +msgstr "قبل از انتساب همراه کپی:" #: src/ownership/double-free-modern-cpp.md:30 msgid "After copy-assignment:" -msgstr "" +msgstr "بعد از انتساب همراه کپی:" #: src/ownership/double-free-modern-cpp.md:57 msgid "" @@ -6219,6 +6319,10 @@ msgid "" "the string data has to be cloned. Otherwise we would get a double-free when " "either string goes out of scope." msgstr "" +"زبان C++ انتخاب کمی متفاوت نسبت به زبان Rust انجام " +"داده است. زیرا `=` داده‌ها را کپی می‌کند، داده‌های رشته باید کلون شوند. در غیر " +"این صورت، هر موقع از اسکوپ یکی از آنها خارج شویم امکان به وجود آمدن اشتباه " +"آزادسازی مجدد حافظه رخ دهد." #: src/ownership/double-free-modern-cpp.md:61 msgid "" @@ -6228,18 +6332,28 @@ msgid "" "move, `s1` would be in a valid but unspecified state. Unlike Rust, the " "programmer is allowed to keep using `s1`." msgstr "" +"البته که زبان C++ دارای [`std::move`](https://en.cppreference.com/w/cpp/utility/move) است که برای انتقال " +"یک متغییر استفاده میشود. اگر مثال ما `s2 = std::move(s1)` بود هیچ تخصیص انباشتی صورت نمیگرفت بلکه `s1` در یک وضعیت معتبر البته " +"نامشخص قرار میگرفت و برخلاف زبان Rust, توی زبان C++ " +"برنامه‌نویس مجاز است که دوباره از `s1` استفاده کند." #: src/ownership/double-free-modern-cpp.md:66 msgid "" "Unlike Rust, `=` in C++ can run arbitrary code as determined by the type " "which is being copied or moved." msgstr "" +"بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم " +"انتقال دادن استفاده شود." #: src/ownership/moves-function-calls.md:3 msgid "" "When you pass a value to a function, the value is assigned to the function " "parameter. This transfers ownership:" msgstr "" +"هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص " +"داده می‌شود. به این شکل مالکیت را منتقل می‌کند:" #: src/ownership/moves-function-calls.md:6 msgid "" @@ -6261,96 +6375,123 @@ msgid "" "With the first call to `say_hello`, `main` gives up ownership of `name`. " "Afterwards, `name` cannot be used anymore within `main`." msgstr "" +"با اولین فراخوانی `say_hello`، تابع `main` مالکیت `name` را انتقال می‌دهد. پس " +"از آن، `name` دیگر نمی‌تواند در `main` استفاده شود." #: src/ownership/moves-function-calls.md:21 msgid "" "The heap memory allocated for `name` will be freed at the end of the " "`say_hello` function." msgstr "" +"حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد " +"خواهد شد." #: src/ownership/moves-function-calls.md:22 msgid "" "`main` can retain ownership if it passes `name` as a reference (`&name`) and " "if `say_hello` accepts a reference as a parameter." msgstr "" +"تابع `main` می‌تواند مالکیت `name` را حفظ کند اگر آن را به عنوان یک مرجع " +"(`&name`) منتقل کند و صد البته که `say_hello` یک مرجع " +"را به عنوان پارامتر باید بپذیرد." #: src/ownership/moves-function-calls.md:23 msgid "" "Alternatively, `main` can pass a clone of `name` in the first call (`name." "clone()`)." msgstr "" +"به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه " +"تابع ای که در نظر داریم (`name.clone()`) منتقل کند." #: src/ownership/moves-function-calls.md:24 msgid "" "Rust makes it harder than C++ to inadvertently create copies by making move " "semantics the default, and by forcing programmers to make clones explicit." msgstr "" +"در زبان Rust سخت‌تر از C++ است که سهوا کپی ایجاد کنیم, " +"زیر به صورت پیش‌فرض از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است " +"هر جا که لازم هست به صورت صریح کلون را ایجاد کند." #: src/ownership/copy-clone.md:3 msgid "" "While move semantics are the default, certain types are copied by default:" msgstr "" +"در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به " +"صورت پیش‌فرض کپی می‌شوند:" #: src/ownership/copy-clone.md:15 msgid "These types implement the `Copy` trait." -msgstr "" +msgstr "این انواع‌داده ویژگی `Copy` را پیاده‌سازی کرده‌اند:" #: src/ownership/copy-clone.md:17 msgid "You can opt-in your own types to use copy semantics:" -msgstr "" +msgstr "البته که میتوان برای نوع‌هایی که میسازید هم مفهوم کپی را داشته باشید:" #: src/ownership/copy-clone.md:32 msgid "After the assignment, both `p1` and `p2` own their own data." -msgstr "" +msgstr "پس از انتساب، هر دو `p1` و `p2` داده‌های خود مستقل خود را دارند.‌" #: src/ownership/copy-clone.md:33 msgid "We can also use `p1.clone()` to explicitly copy the data." msgstr "" +"همچنین می‌توانیم از `p1.clone()` برای کپی صریح داده‌ها " +"استفاده کنیم." #: src/ownership/copy-clone.md:37 msgid "Copying and cloning are not the same thing:" -msgstr "" +msgstr "کپی‌برداری و کلون‌سازی یکسان نیستند:" #: src/ownership/copy-clone.md:39 msgid "" "Copying refers to bitwise copies of memory regions and does not work on " "arbitrary objects." msgstr "" +"کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع " +"تعریف شده توسط شما کار نمی‌کند." #: src/ownership/copy-clone.md:40 msgid "" "Copying does not allow for custom logic (unlike copy constructors in C++)." msgstr "" +"کپی‌برداری اجازه منطق سفارشی را نمی‌دهد (بر خلاف کپی constructors در C++)." #: src/ownership/copy-clone.md:41 msgid "" "Cloning is a more general operation and also allows for custom behavior by " "implementing the `Clone` trait." msgstr "" +"کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان " +"رفتار سفارشی را فراهم می‌کند." #: src/ownership/copy-clone.md:42 msgid "Copying does not work on types that implement the `Drop` trait." msgstr "" +"کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." #: src/ownership/copy-clone.md:44 src/ownership/lifetimes-function-calls.md:30 msgid "In the above example, try the following:" -msgstr "" +msgstr "در مثال بالا، موارد زیر را امتحان کنید:" #: src/ownership/copy-clone.md:46 msgid "" "Add a `String` field to `struct Point`. It will not compile because `String` " "is not a `Copy` type." msgstr "" +"یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` " +"یک نوع `Copy` نیست." #: src/ownership/copy-clone.md:47 msgid "" "Remove `Copy` from the `derive` attribute. The compiler error is now in the " "`println!` for `p1`." msgstr "" +"ویژگی `Copy` را از ویژگی‌های `derive` حذف کنید. خطای کامپایلر اکنون در `println!` برای `p1` است." #: src/ownership/copy-clone.md:48 msgid "Show that it works if you clone `p1` instead." -msgstr "" +msgstr "نشان دهید که اگر `p1` را به جای کپی آن کلون کنید، کار می‌کند." #: src/ownership/copy-clone.md:50 msgid "" @@ -6358,6 +6499,9 @@ msgid "" "to generate code in Rust at compile time. In this case the default " "implementations of `Copy` and `Clone` traits are generated." msgstr "" +"اگر دانشجویان در مورد `derive` پرسیدند، کافی است بگوییم که این راهی برای " +"تولید کد در`Rust` در زمان کامپایل است. در این مورد، پیاده‌سازی‌های پیش‌فرض " +"صفت‌های `Copy` و `Clone` تولید می‌شوند." #: src/ownership/borrowing.md:3 msgid "" From 5accd40598e42a00bef10b65c344701632a05277 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Sun, 19 Nov 2023 22:23:52 +0330 Subject: [PATCH 20/23] Apply suggestions from code review Co-authored-by: Kaveh --- po/fa.po | 142 +++++++++++++++++++++++++++---------------------------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/po/fa.po b/po/fa.po index 2d2957e390d9..6737c5123ea1 100644 --- a/po/fa.po +++ b/po/fa.po @@ -3279,11 +3279,11 @@ msgstr "" #: src/basic-syntax/references.md:3 msgid "Like C++, Rust has references:" -msgstr "مانند C++، Rust دارای مراجع است:" +msgstr "مانند C++، راست دارای مراجع است:" #: src/basic-syntax/references.md:15 msgid "Some notes:" -msgstr "برخی از نکات:" +msgstr "نکته:" #: src/basic-syntax/references.md:17 msgid "" @@ -3298,7 +3298,7 @@ msgid "" "Rust will auto-dereference in some cases, in particular when invoking " "methods (try `ref_x.count_ones()`)." msgstr "" -"زبان Rust در برخی موارد به‌طور خودکار از ارجاع دهی صرف‌نظر می‌کند، به‌ویژه هنگام " +"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام " "فراخوانی متدها (`ref_x.count_ones()` را امتحان کنید)." #: src/basic-syntax/references.md:20 @@ -3306,7 +3306,7 @@ msgid "" "References that are declared as `mut` can be bound to different values over " "their lifetime." msgstr "" -"مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " +"مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " "مختلفی ارجاع داده شوند." #: src/basic-syntax/references.md:26 @@ -3323,19 +3323,19 @@ msgstr "" #: src/basic-syntax/references-dangling.md:3 msgid "Rust will statically forbid dangling references:" -msgstr "Rust از نظر استاتیکی مراجع (تعلیق شده)`dangling` را ممنوع می‌کند:" +msgstr "راست بطور استاتیک مراجع تعلیق شده (dangling) را ممنوع می‌کند:" #: src/basic-syntax/references-dangling.md:17 msgid "A reference is said to \"borrow\" the value it refers to." -msgstr "گفته می‌شود که یک مرجع مقدار مورد نظر خود را «قرض می‌گیرند»." +msgstr "گفته می‌شود که یک مرجع مقدار مورد اشاره خود را «قرض می‌گیرد»." #: src/basic-syntax/references-dangling.md:18 msgid "" "Rust is tracking the lifetimes of all references to ensure they live long " "enough." msgstr "" -"زبان Rust برای اینکه اطمینان حال کند طول‌عمر همه مراجع به اندازه کافی است, " -"آنها را رهگیری میکند." +"راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, " +"آنها را رهگیری می‌کند." #: src/basic-syntax/references-dangling.md:20 msgid "We will talk more about borrowing when we get to ownership." @@ -3362,7 +3362,7 @@ msgid "" "We create a slice by borrowing `a` and specifying the starting and ending " "indexes in brackets." msgstr "" -"ما با قرض گرفتن `a` و مشخص کردن ایندس‌های شروع و پایان " +"ما با قرض گرفتن `a` و مشخص کردن شاخص‌های شروع و پایان " "در براکت‌ها، برش (slice) ایجاد می‌کنیم." #: src/basic-syntax/slices.md:24 @@ -3371,7 +3371,7 @@ msgid "" "starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " "identical." msgstr "" -"اگر برش را از اندیس 0 شروع شود، سینتکس زبانRust به ما اجازه می‌دهد اندیس شروع " +"اگر برش از شاخص ۰ شروع شود، سینتکس راست به ما اجازه می‌دهد شاخص شروع " "را حذف کنیم (یعنی عدد صفر را ننویسیم)، به این معنی که `&a[0.." "a.len()]` و `&a[..a.len()]` یکسان هستند." @@ -3380,8 +3380,8 @@ msgid "" "The same is true for the last index, so `&a[2..a.len()]` and `&a[2..]` are " "identical." msgstr "" -"در مورد اندیس آخر نیز همینطور است، بنابراین `&a[2..a.len()]` و `&a[2..]` یکسان هستند." +"در مورد شاخص آخر نیز همینطور است، بنابراین `&a[2..a.len()]` و `&a[2..]` یکسان هستند." #: src/basic-syntax/slices.md:28 msgid "" @@ -3406,8 +3406,8 @@ msgid "" "Slices always borrow from another object. In this example, `a` has to remain " "'alive' (in scope) for at least as long as our slice. " msgstr "" -"برش‌ها همیشه از یک شیء دیگر قرض می گیرند. در این مثال، `a` باید حداقل به اندازه طول‌عمر برش ما، فعال (در محدوده) باقی بماند. " +"برش‌ها همیشه از یک شیء دیگر قرض می‌گیرند. در این مثال، `a` باید حداقل به اندازه طول‌عمر برش ما، زنده (در محدوده) باقی بماند. " #: src/basic-syntax/slices.md:34 msgid "" @@ -3419,12 +3419,12 @@ msgid "" "in the borrow checker section." msgstr "" "پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع " -"کند، اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی توانید این کار را از " +"کند، اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از " "طریق `a` در این مرحله از اجرا انجام دهید، اما می‌توانید " -"داده ها را از هر دو `a` و `s` به " -"طور ایمن بخوانید. این کار قبل از ایجاد اسلایس و دوباره بعد از `a` و `s` به " +"طور ایمن بخوانید. این کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، زمانی که برش دیگر استفاده نمی شود. " -"جزئیات بیشتری در بخش بررسی کننده‌قرض (the borrow checker) توضیح داده خواهیم " +"جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow checker) توضیح خواهیم " "داد. " #: src/basic-syntax/string-slices.md:1 @@ -3433,7 +3433,7 @@ msgstr "`String` در مقابل `str` #: src/basic-syntax/string-slices.md:3 msgid "We can now understand the two string types in Rust:" -msgstr "حالا می توانیم دو نوع رشته ای را در Rust درک کنیم:" +msgstr "حالا می‌توانیم دو نوع رشته‌ای را در راست درک کنیم:" #: src/basic-syntax/string-slices.md:5 msgid "" @@ -3455,17 +3455,17 @@ msgstr "" #: src/basic-syntax/string-slices.md:20 msgid "Rust terminology:" -msgstr "اصطلاحات Rust:" +msgstr "اصطلاحات راست:" #: src/basic-syntax/string-slices.md:22 msgid "`&str` an immutable reference to a string slice." msgstr "" "&str یک مرجع غیرقابل تغییر " -"به یک برش رشته ای است." +"به یک برش از رشته‌ است." #: src/basic-syntax/string-slices.md:23 msgid "`String` a mutable string buffer." -msgstr "`String` یک بافر رشته ای قابل تغییر است." +msgstr "`String` یک بافر رشته‌ای قابل تغییر است." #: src/basic-syntax/string-slices.md:27 msgid "" @@ -3473,18 +3473,18 @@ msgid "" "encoded string data stored in a block of memory. String literals " "(`”Hello”`), are stored in the program’s binary." msgstr "" -"`&str` یک برش رشته ای را معرفی می کند، که یک مرجع " -"غیرقابل تغییر به داده های رشته ای انکود شده UTF-8 است که در یک بلوک حافظه " -"ذخیره شده است. لیترال های رشته ای `String` (`”Hello”`) " -"در باینری برنامه ذخیره می شوند." +"`&str` یک برش رشته‌ای را معرفی می‌کند، که یک مرجع " +"غیرقابل تغییر به داده‌های رشته‌ای رمزشده UTF-8 است که در یک بلوک حافظه " +"ذخیره شده است. لیترال های رشته‌ای `String` (`”Hello”`) " +"در باینری برنامه ذخیره می‌شوند." #: src/basic-syntax/string-slices.md:30 msgid "" "Rust’s `String` type is a wrapper around a vector of bytes. As with a " "`Vec`, it is owned." msgstr "" -"در زبان Rust نوع ‍`String` یک wrapper برای یک بردار از " -"بایت‌هاست. به عنوان `Vec` وجود دارد، مالکیت آن دارد." +"در راست نوع ‍`String` یک wrapper بر روی یک بردار از " +"بایت‌هاست. مانند `Vec`، یک نوع Owned است." #: src/basic-syntax/string-slices.md:32 msgid "" @@ -3493,9 +3493,9 @@ msgid "" "can be added using the `push()` and `push_str()` methods." msgstr "" "مانند بسیاری از انواع دیگر، `String::from()` یک رشته از " -"یک لیترال رشته ایجاد می کند. `String::new()` ک رشته " -"خالی جدید ایجاد می کند که داده های رشته ای می توانند با استفاده از متدهای " -"`push()` و `push_str()` به آن " +"یک لیترال رشته ایجاد می‌کند. `String::new()` که رشته " +"خالی جدید ایجاد می‌کند که داده های رشته‌ای می‌توانند با استفاده از متدهای " +"`push()` و `push_str()` به آن " "اضافه شوند." #: src/basic-syntax/string-slices.md:35 @@ -3503,8 +3503,8 @@ msgid "" "The `format!()` macro is a convenient way to generate an owned string from " "dynamic values. It accepts the same format specification as `println!()`." msgstr "" -"ماکرو `format!()` یک راه راحت برای ایجاد یک رشته متعلق " -"به مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!" +"ماکرو `format!()` یک راه راحت برای ایجاد یک رشته Owned " +"از مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!" "()` است." #: src/basic-syntax/string-slices.md:38 @@ -3512,8 +3512,8 @@ msgid "" "You can borrow `&str` slices from `String` via `&` and optionally range " "selection." msgstr "" -"شما می توانید برش‌های &str را از `String` از طریق `&` و " -"انتخاب محدوده به صورت اختیاری، قرض بگیرید." +"شما می‌توانید برش‌های &str را از `String` از طریق `&` و " +"انتخاب محدوده به صورت اختیاری، قرض بگیرید." #: src/basic-syntax/string-slices.md:40 msgid "" @@ -3522,20 +3522,20 @@ msgid "" "equivalent of `std::string` from C++ (main difference: it can only contain " "UTF-8 encoded bytes and will never use a small-string optimization)." msgstr "" -"برای برنامه نویسان `C++`: `&str``C++`: `&str`را به عنوان `const char*` در `C++` درنظر بگیرید، اما یک فرق مهم این است که در راست که همیشه به یک رشته " -"معتبر در حافظه اشاره می کند. زبان Rust نوع `String``String`معادل تقریبی `std::string` در `C++` است (با این تفاوت که فقط می تواند حاوی بایت های انکودینگ شده UTF-8 " -"باشد و هرگز از بهینه سازی رشته کوچک استفاده نمی کند)." +"span> است (با این تفاوت که فقط می‌تواند حاوی بایت‌های رمزشده UTF-8 " +"باشد و هرگز از بهینه‌سازی Small-String استفاده نمی کند)." #: src/basic-syntax/functions.md:3 msgid "" "A Rust version of the famous [FizzBuzz](https://en.wikipedia.org/wiki/" "Fizz_buzz) interview question:" msgstr "" -"یک نسخه به زبان Rust از سوال مصاحبه معروف [FizzBuzz](https://en.wikipedia." +"یک نسخه راست از سوال مصاحبه معروف مصاحبه [FizzBuzz](https://en.wikipedia." "org/wiki/Fizz_buzz):" #: src/basic-syntax/functions.md:36 @@ -3544,7 +3544,7 @@ msgid "" "nor headers are necessary. " msgstr "" "ما در `main` به یک تابعی که در زیرش نوشته شده است اشاره " -"می کنیم. نیازی به اعلان از قبل تابع `main` یا در بخش " +"می‌کنیم. نیازی به اعلان از قبل تابع `main` یا در بخش " "هدر نیست. " #: src/basic-syntax/functions.md:37 @@ -3570,8 +3570,8 @@ msgid "" "compiler will infer this if the `-> ()` return type is omitted." msgstr "" "برخی از توابع هیچ مقدار برگشتی ندارند و «نوع یکه» `()` " -"را برمی گردانند. اگر `-> ()` از بخش نوع برگشتی حذف شود، " -"کامپایلر این را استنتاج خواهد داشت که هیچ نوع برگشتی وجود ندارد." +"را برمی‌گردانند. اگر `-> ()` از بخش نوع برگشتی حذف شود، " +"کامپایلر این را استنتاج خواهد کرد که هیچ نوع برگشتی وجود ندارد." #: src/basic-syntax/functions.md:40 msgid "" @@ -3586,8 +3586,8 @@ msgstr "" msgid "" "All language items in Rust can be documented using special `///` syntax." msgstr "" -"همه موارد زبانی در Rust را می‌توان با استفاده از سینتکس ویژه `///` داکیومنت " -"شوند." +"همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند " +"کرد." #: src/basic-syntax/rustdoc.md:5 msgid "" @@ -3619,12 +3619,12 @@ msgid "" "idiomatic to document all public items in an API using this pattern. Code " "snippets can document usage and will be used as unit tests." msgstr "" -"محتوا کامنت شده به عنوان `Markdown` در نظر گرفته می‌شود. تمام جعبه‌هایی که در " -"Rust منتشر می‌شوند به‌طور خودکار با استفاده از ابزار [rustdoc](https://doc." +"محتوا کامنت شده به عنوان `Markdown` در نظر گرفته می‌شود. تمام جعبه‌هایی (Crate) که در " +"راست منتشر می‌شوند به‌طور خودکار با استفاده از ابزار [rustdoc](https://doc." "rust-lang.org/rustdoc/what-is-rustdoc.html) در [`docs.rs`](https://docs.rs) " "مستند می‌شوند. این یک سبک رایج است که تمام آیتم‌های عمومی در یک API با استفاده " -"از این الگو داکیونت شود.همچنین میتوان قطعه کدهایی شامل نحوه استفاده را " -"داکیومنت کرد و به عنوان تست‌های واحد (unit tests) استفاده خواهند شد." +"از این الگو مستند شود. همچنین میتوان قطعه کدهایی شامل نحوه استفاده را " +"مستند کرد و به عنوان تست‌های واحد (unit tests) استفاده خواهند شد." #: src/basic-syntax/rustdoc.md:30 msgid "" @@ -3665,7 +3665,7 @@ msgid "" "Methods are functions associated with a type. The `self` argument of a " "method is an instance of the type it is associated with:" msgstr "" -"متدها تابع‌هایی هستند که به یک نوع خاص هستند. آرگومان `self` یک متد، نمونه‌ای " +"متدها، تابع‌هایی مربوط به یک نوع خاص هستند. آرگومان `self` یک متد، نمونه‌ای " "از نوعی است که با آن مرتبط است:" #: src/basic-syntax/methods.md:6 @@ -3714,10 +3714,10 @@ msgid "" "constructor, `Rectangle { width, height }`, could be called directly. See " "the [Rustnomicon](https://doc.rust-lang.org/nomicon/constructors.html)." msgstr "" -"در حالی که از _نظر فنی_ زبان Rust یک متد سازنده خاص ندارد، معمولاً از " -"متدهای استاتیک برای مقداردهی اولیه ساختارها استفاده می‌شود (اما الزامی " +"در حالی که از _نظر فنی_ راست یک متد سازنده خاص ندارد، معمولاً از " +"متدهای استاتیک برای مقداردهی اولیه ساختارها استفاده می‌شود (اما الزامی " "نیست). سازنده اصلی ، `Rectangle { width, height }` ، " -"را می‌تواند به طور مستقیم فراخوانی کرد. برای اطلاعات بیشتر [Rustnomicon]" +"را می‌توان به طور مستقیم فراخوانی کرد. برای اطلاعات بیشتر [Rustnomicon]" "(https://doc.rust-lang.org/nomicon/constructors.html) را ببینید." #: src/basic-syntax/methods.md:45 @@ -3739,7 +3739,7 @@ msgstr "سربارگذاری پشتیبانی نمیشود, چون:" #: src/basic-syntax/functions-interlude.md:5 msgid "Each function has a single implementation:" -msgstr "هر تابع پیاده سازی یکتایی دارد:" +msgstr "هر تابع فقط یک پیاده سازی دارد:" #: src/basic-syntax/functions-interlude.md:6 msgid "Always takes a fixed number of parameters." @@ -3747,11 +3747,11 @@ msgstr "همیشه تعداد ثابتی از آرگومان‌ها می‌گی #: src/basic-syntax/functions-interlude.md:7 msgid "Always takes a single set of parameter types." -msgstr "همیشه یک مجموعه واحد از انواع آرگومان‌ها ار می‌گیرد." +msgstr "همیشه یک مجموعه واحد از انواع آرگومان‌ها را می‌گیرد." #: src/basic-syntax/functions-interlude.md:8 msgid "Default values are not supported:" -msgstr "مقادیر پیش فرض پشتیبانی نمی شوند:" +msgstr "مقادیر پیش‌فرض پشتیبانی نمی‌شوند:" #: src/basic-syntax/functions-interlude.md:9 msgid "All call sites have the same number of arguments." @@ -3759,7 +3759,7 @@ msgstr "تمام محل‌های فراخوانی دارای تعداد یکسا #: src/basic-syntax/functions-interlude.md:10 msgid "Macros are sometimes used as an alternative." -msgstr "گاهی اوقات از ماکروها به عنوان جایگزین این کار استفاده می‌شود." +msgstr "گاهی اوقات از ماکروها به عنوان جایگزین استفاده می‌شود." #: src/basic-syntax/functions-interlude.md:12 msgid "However, function parameters can be generic:" @@ -3786,20 +3786,20 @@ msgid "" "section." msgstr "" "هنگام استفاده از جنریک‌ها، `Into` کتابخانه استاندارد " -"می تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها فراهم کند. " +"می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها فراهم کند. " "جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." #: src/exercises/day-1/morning.md:1 msgid "Day 1: Morning Exercises" -msgstr "روز اول: تمرین‌های صبحگاه" +msgstr "روز اول: تمرین‌های صبح" #: src/exercises/day-1/morning.md:3 msgid "In these exercises, we will explore two parts of Rust:" -msgstr "در این تمرین‌ها، دو بخش از Rust را بررسی خواهیم کرد:" +msgstr "در این تمرین‌ها، دو بخش از راست را بررسی خواهیم کرد:" #: src/exercises/day-1/morning.md:5 msgid "Implicit conversions between types." -msgstr "تبدیل‌های صریح بین انواع" +msgstr "تبدیل‌های ضمنی بین انواع" #: src/exercises/day-1/morning.md:7 msgid "Arrays and `for` loops." @@ -3815,8 +3815,8 @@ msgid "" "completion in your editor. See the page about [Using Cargo](../../cargo.md) " "for details on installing Rust." msgstr "" -"در صورت امکان، از نصب محلی Rust استفاده کنید. از این طریق می‌توانید از تکمیل " -"خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب Rust، " +"در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از تکمیل " +"خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب راست، " "صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." #: src/exercises/day-1/morning.md:17 @@ -3828,8 +3828,8 @@ msgid "" "The code snippets are not editable on purpose: the inline code snippets lose " "their state if you navigate away from the page." msgstr "" -"قطعه کدها به صورت عمدی قابل ویرایش با ماندگاری تغییرات نیستند: قطعه کدهای " -"درون‌خطی اگر از صفحه خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات " +"قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای " +"درون‌خطی اگر از صفحه خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات " "شما درنظر گرفته نمی‌شود." #: src/exercises/day-1/morning.md:22 src/exercises/day-2/morning.md:11 @@ -3848,9 +3848,9 @@ msgid "" "([unlike C++](https://en.cppreference.com/w/cpp/language/" "implicit_conversion)). You can see this in a program like this:" msgstr "" -"Rust به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " +"راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " "`C++`](https://en.cppreference.com/w/cpp/language/" -"implicit_conversion)).به عنوان مثال میتونید این رو توی یک برنامه ببنید:" +"implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" #: src/exercises/day-1/implicit-conversions.md:20 msgid "" @@ -3861,14 +3861,14 @@ msgid "" "trait has a single `into()` method. Implementing these traits is how a type " "expresses that it can be converted into another type." msgstr "" -"همه انواع عدد صحیح Rust، ویژگی‌های [`Into`](https://" +"همه انواع عدد صحیح راست، تریت‌های (Trait) [`Into`](https://" "doc.rust-lang.org/std/convert/trait.Into.html) و [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) را پیاده‌سازی " -"می‌کنندتا به ما امکان تبدیل بین انواع عددی صحیح را فراهم کنند. با پیاده سازی " +"می‌کنند تا به ما امکان تبدیل بین انواع عددی صحیح را بدهند. با پیاده سازی " "ویژگی `From` همه انواع به صورت مشترک یک متد `from()` را دارند. با پیاده سازی ویژگی `from()` را دارند. با پیاده‌سازی تریت `Into` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این ویژگی‌ها راهی است که یک نوع " +"dir=ltr>`into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع " "بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." #: src/exercises/day-1/implicit-conversions.md:26 From 9f278aaeae33a03406cf7703248f81e127747ebf Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Sun, 19 Nov 2023 22:36:12 +0330 Subject: [PATCH 21/23] reformated --- po/fa.po | 98 +++++++++++++++++++++++++++----------------------------- 1 file changed, 47 insertions(+), 51 deletions(-) diff --git a/po/fa.po b/po/fa.po index 6737c5123ea1..049882360426 100644 --- a/po/fa.po +++ b/po/fa.po @@ -3298,8 +3298,8 @@ msgid "" "Rust will auto-dereference in some cases, in particular when invoking " "methods (try `ref_x.count_ones()`)." msgstr "" -"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام " -"فراخوانی متدها (`ref_x.count_ones()` را امتحان کنید)." +"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " +"متدها (`ref_x.count_ones()` را امتحان کنید)." #: src/basic-syntax/references.md:20 msgid "" @@ -3334,8 +3334,8 @@ msgid "" "Rust is tracking the lifetimes of all references to ensure they live long " "enough." msgstr "" -"راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, " -"آنها را رهگیری می‌کند." +"راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, آنها " +"را رهگیری می‌کند." #: src/basic-syntax/references-dangling.md:20 msgid "We will talk more about borrowing when we get to ownership." @@ -3362,8 +3362,8 @@ msgid "" "We create a slice by borrowing `a` and specifying the starting and ending " "indexes in brackets." msgstr "" -"ما با قرض گرفتن `a` و مشخص کردن شاخص‌های شروع و پایان " -"در براکت‌ها، برش (slice) ایجاد می‌کنیم." +"ما با قرض گرفتن `a` و مشخص کردن شاخص‌های شروع و پایان در " +"براکت‌ها، برش (slice) ایجاد می‌کنیم." #: src/basic-syntax/slices.md:24 msgid "" @@ -3371,9 +3371,9 @@ msgid "" "starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " "identical." msgstr "" -"اگر برش از شاخص ۰ شروع شود، سینتکس راست به ما اجازه می‌دهد شاخص شروع " -"را حذف کنیم (یعنی عدد صفر را ننویسیم)، به این معنی که `&a[0.." -"a.len()]` و `&a[..a.len()]` یکسان هستند." +"اگر برش از شاخص ۰ شروع شود، سینتکس راست به ما اجازه می‌دهد شاخص شروع را حذف " +"کنیم (یعنی عدد صفر را ننویسیم)، به این معنی که `&a[0..a." +"len()]` و `&a[..a.len()]` یکسان هستند." #: src/basic-syntax/slices.md:26 msgid "" @@ -3424,8 +3424,7 @@ msgstr "" "داده‌ها را از هر دو `a` و `s` به " "طور ایمن بخوانید. این کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، زمانی که برش دیگر استفاده نمی شود. " -"جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow checker) توضیح خواهیم " -"داد. " +"جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow checker) توضیح خواهیم داد. " #: src/basic-syntax/string-slices.md:1 msgid "`String` vs `str`" @@ -3474,9 +3473,9 @@ msgid "" "(`”Hello”`), are stored in the program’s binary." msgstr "" "`&str` یک برش رشته‌ای را معرفی می‌کند، که یک مرجع " -"غیرقابل تغییر به داده‌های رشته‌ای رمزشده UTF-8 است که در یک بلوک حافظه " -"ذخیره شده است. لیترال های رشته‌ای `String` (`”Hello”`) " -"در باینری برنامه ذخیره می‌شوند." +"غیرقابل تغییر به داده‌های رشته‌ای رمزشده UTF-8 است که در یک بلوک حافظه ذخیره " +"شده است. لیترال های رشته‌ای `String` (`”Hello”`) در " +"باینری برنامه ذخیره می‌شوند." #: src/basic-syntax/string-slices.md:30 msgid "" @@ -3494,9 +3493,8 @@ msgid "" msgstr "" "مانند بسیاری از انواع دیگر، `String::from()` یک رشته از " "یک لیترال رشته ایجاد می‌کند. `String::new()` که رشته " -"خالی جدید ایجاد می‌کند که داده های رشته‌ای می‌توانند با استفاده از متدهای " -"`push()` و `push_str()` به آن " -"اضافه شوند." +"خالی جدید ایجاد می‌کند که داده های رشته‌ای می‌توانند با استفاده از متدهای `push()` و `push_str()` به آن اضافه شوند." #: src/basic-syntax/string-slices.md:35 msgid "" @@ -3522,21 +3520,21 @@ msgid "" "equivalent of `std::string` from C++ (main difference: it can only contain " "UTF-8 encoded bytes and will never use a small-string optimization)." msgstr "" -"برای برنامه‌نویسان `C++`: `&str`را به عنوان `const char*` در `C++` درنظر بگیرید، اما یک فرق مهم این است که در راست که همیشه به یک رشته " -"معتبر در حافظه اشاره می کند. راست نوع `String`معادل تقریبی `std::string` در `C++` است (با این تفاوت که فقط می‌تواند حاوی بایت‌های رمزشده UTF-8 " -"باشد و هرگز از بهینه‌سازی Small-String استفاده نمی کند)." +"برای برنامه‌نویسان `C++`: `&str`را " +"به عنوان `const char*` در `C++` " +"درنظر بگیرید، اما یک فرق مهم این است که در راست که همیشه به یک رشته معتبر در " +"حافظه اشاره می کند. راست نوع `String`معادل تقریبی `std::string` در `C++` است (با این تفاوت " +"که فقط می‌تواند حاوی بایت‌های رمزشده UTF-8 باشد و هرگز از بهینه‌سازی Small-" +"String استفاده نمی کند)." #: src/basic-syntax/functions.md:3 msgid "" "A Rust version of the famous [FizzBuzz](https://en.wikipedia.org/wiki/" "Fizz_buzz) interview question:" msgstr "" -"یک نسخه راست از سوال مصاحبه معروف مصاحبه [FizzBuzz](https://en.wikipedia." -"org/wiki/Fizz_buzz):" +"یک نسخه راست از سوال مصاحبه معروف مصاحبه [FizzBuzz](https://en.wikipedia.org/" +"wiki/Fizz_buzz):" #: src/basic-syntax/functions.md:36 msgid "" @@ -3586,8 +3584,7 @@ msgstr "" msgid "" "All language items in Rust can be documented using special `///` syntax." msgstr "" -"همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند " -"کرد." +"همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند کرد." #: src/basic-syntax/rustdoc.md:5 msgid "" @@ -3619,19 +3616,19 @@ msgid "" "idiomatic to document all public items in an API using this pattern. Code " "snippets can document usage and will be used as unit tests." msgstr "" -"محتوا کامنت شده به عنوان `Markdown` در نظر گرفته می‌شود. تمام جعبه‌هایی (Crate) که در " -"راست منتشر می‌شوند به‌طور خودکار با استفاده از ابزار [rustdoc](https://doc." -"rust-lang.org/rustdoc/what-is-rustdoc.html) در [`docs.rs`](https://docs.rs) " -"مستند می‌شوند. این یک سبک رایج است که تمام آیتم‌های عمومی در یک API با استفاده " -"از این الگو مستند شود. همچنین میتوان قطعه کدهایی شامل نحوه استفاده را " -"مستند کرد و به عنوان تست‌های واحد (unit tests) استفاده خواهند شد." +"محتوا کامنت شده به عنوان `Markdown` در نظر گرفته می‌شود. تمام جعبه‌هایی " +"(Crate) که در راست منتشر می‌شوند به‌طور خودکار با استفاده از ابزار [rustdoc]" +"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) در [`docs.rs`]" +"(https://docs.rs) مستند می‌شوند. این یک سبک رایج است که تمام آیتم‌های عمومی در " +"یک API با استفاده از این الگو مستند شود. همچنین میتوان قطعه کدهایی شامل نحوه " +"استفاده را مستند کرد و به عنوان تست‌های واحد (unit tests) استفاده خواهند شد." #: src/basic-syntax/rustdoc.md:30 msgid "" "Show students the generated docs for the `rand` crate at [`docs.rs/rand`]" "(https://docs.rs/rand)." msgstr "" -"دانشجویان را با داکیومنت‌های تولید شده برای جعبه `rand` در [`docs.rs/rand`]" +"دانشجویان را با مستندات تولید شده برای جعبه `rand` در [`docs.rs/rand`]" "(https://docs.rs/rand) آشنا کنید." #: src/basic-syntax/rustdoc.md:33 @@ -3665,8 +3662,8 @@ msgid "" "Methods are functions associated with a type. The `self` argument of a " "method is an instance of the type it is associated with:" msgstr "" -"متدها، تابع‌هایی مربوط به یک نوع خاص هستند. آرگومان `self` یک متد، نمونه‌ای " -"از نوعی است که با آن مرتبط است:" +"متدها، تابع‌هایی مربوط به یک نوع خاص هستند. آرگومان `self` یک متد، نمونه‌ای از " +"نوعی است که با آن مرتبط است:" #: src/basic-syntax/methods.md:6 msgid "" @@ -3714,11 +3711,11 @@ msgid "" "constructor, `Rectangle { width, height }`, could be called directly. See " "the [Rustnomicon](https://doc.rust-lang.org/nomicon/constructors.html)." msgstr "" -"در حالی که از _نظر فنی_ راست یک متد سازنده خاص ندارد، معمولاً از " -"متدهای استاتیک برای مقداردهی اولیه ساختارها استفاده می‌شود (اما الزامی " -"نیست). سازنده اصلی ، `Rectangle { width, height }` ، " -"را می‌توان به طور مستقیم فراخوانی کرد. برای اطلاعات بیشتر [Rustnomicon]" -"(https://doc.rust-lang.org/nomicon/constructors.html) را ببینید." +"در حالی که از _نظر فنی_ راست یک متد سازنده خاص ندارد، معمولاً از متدهای " +"استاتیک برای مقداردهی اولیه ساختارها استفاده می‌شود (اما الزامی نیست). سازنده " +"اصلی ، `Rectangle { width, height }` ، را می‌توان به " +"طور مستقیم فراخوانی کرد. برای اطلاعات بیشتر [Rustnomicon](https://doc.rust-" +"lang.org/nomicon/constructors.html) را ببینید." #: src/basic-syntax/methods.md:45 msgid "" @@ -3828,9 +3825,8 @@ msgid "" "The code snippets are not editable on purpose: the inline code snippets lose " "their state if you navigate away from the page." msgstr "" -"قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای " -"درون‌خطی اگر از صفحه خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات " -"شما درنظر گرفته نمی‌شود." +"قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه " +"خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته نمی‌شود." #: src/exercises/day-1/morning.md:22 src/exercises/day-2/morning.md:11 #: src/exercises/day-3/morning.md:9 src/exercises/bare-metal/morning.md:7 @@ -3861,12 +3857,12 @@ msgid "" "trait has a single `into()` method. Implementing these traits is how a type " "expresses that it can be converted into another type." msgstr "" -"همه انواع عدد صحیح راست، تریت‌های (Trait) [`Into`](https://" -"doc.rust-lang.org/std/convert/trait.Into.html) و [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) را پیاده‌سازی " -"می‌کنند تا به ما امکان تبدیل بین انواع عددی صحیح را بدهند. با پیاده سازی " -"ویژگی `From` همه انواع به صورت مشترک یک متد `from()` را دارند. با پیاده‌سازی تریت `Into`]" +"(https://doc.rust-lang.org/std/convert/trait.Into.html) و [`From`](https://doc.rust-lang.org/std/convert/trait.From." +"html) را پیاده‌سازی می‌کنند تا به ما امکان تبدیل بین انواع عددی صحیح را بدهند. " +"با پیاده سازی ویژگی `From` همه انواع به صورت مشترک " +"یک متد `from()` را دارند. با پیاده‌سازی تریت `Into` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع " "بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." From b9445d2f4e885dfca81384a74f6dfe28946926e8 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Sat, 2 Dec 2023 14:28:47 +0330 Subject: [PATCH 22/23] Apply suggestions from code review Co-authored-by: Kaveh --- po/fa.po | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/po/fa.po b/po/fa.po index 049882360426..7dbbaafce4f1 100644 --- a/po/fa.po +++ b/po/fa.po @@ -3875,13 +3875,13 @@ msgid "" "i16` implementation automatically create an implementation of `Into for " "i8`." msgstr "" -"کتابخانه استاندارد پیاده‌سازی `From i16` به نوع " +"کتابخانه استاندارد یک پیاده‌سازی `From for i16` دارد " "`i16` دارد، به این معنی که می‌توانیم یک متغیر `x` از نوع " "`i8` را با فراخوانی `i16::from(x)` به یک `i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x." "into()` ، زیرا پیاده‌سازی `From` برای نوع " "`i16` به طور خودکار پیاده‌سازی`Into` براینوع `i8` را ایجاد می‌کند." +"dir=ltr>`Into` برای نوع `i8` را ایجاد می‌کند." #: src/exercises/day-1/implicit-conversions.md:31 msgid "" @@ -3896,7 +3896,7 @@ msgstr "" #: src/exercises/day-1/implicit-conversions.md:34 msgid "Execute the above program and look at the compiler error." -msgstr "برنامه فوق را اجرا کنید و به خطای کامپایلر نگاه کنید." +msgstr "برنامه فوق را اجرا و به خطای کامپایلر نگاه کنید." #: src/exercises/day-1/implicit-conversions.md:36 msgid "Update the code above to use `into()` to do the conversion." @@ -3916,7 +3916,7 @@ msgstr "" "دهید تا ببینید کدام انواع را می‌توانید به کدام انواع دیگر تبدیل کنید. سعی " "کنید انواع کوچک را به انواع بزرگ تبدیل کنید و برعکس. [مستندات کتابخانه " "استاندارد](https://doc.rust-lang.org/std/convert/trait.From.html) را بررسی " -"کنید تا ببینید آیا `From` برای تبدیل نوع‌هاییکه " +"کنید تا ببینید آیا `From` برای تبدیل انواع‌ایی که " "بررسی می‌کنید پیاده‌سازی شده است یا نه." #: src/exercises/day-1/for-loops.md:1 @@ -3941,7 +3941,7 @@ msgid "" "Rust lets you iterate over things like arrays and ranges using the `for` " "keyword:" msgstr "" -"زبان Rust به شما این امکان می‌دهد با استفاده از کلمه کلیدی `for` بر روی " +"راست به شما این امکان را می‌دهد تا با استفاده از کلمه کلیدی `for` بر روی " "چیزهایی مانند آرایه‌ها و رنج‌ها پیمایش کنید:" #: src/exercises/day-1/for-loops.md:22 @@ -3970,7 +3970,7 @@ msgid "" "and a function `transpose` which will transpose a matrix (turn rows into " "columns):" msgstr "" -"از موارد فوق برای نوشتن تابع `pretty_print` که یک " +"از کد بالا برای نوشتن تابع `pretty_print` که یک " "ماتریس را به صورت `pretty-print` چاپ می‌کند و تابع " "`transpose` که یک ماتریس را جابجا می‌کند (ردیف‌ها را به " "ستون‌ها تبدیل می‌کند) استفاده کنید: " @@ -3984,7 +3984,7 @@ msgid "" "Copy the code below to and implement the " "functions:" msgstr "" -"کد زیر را در کپی کنید و " +"کد زیر را در کپی کرده و " "توابع را پیاده‌سازی کنید:" #: src/exercises/day-1/for-loops.md:54 @@ -4020,7 +4020,7 @@ msgstr "" #: src/exercises/day-1/for-loops.md:82 msgid "Bonus Question" -msgstr "سوال جایزه" +msgstr "سوال جایزه‌دار" #: src/exercises/day-1/for-loops.md:84 msgid "" @@ -4031,14 +4031,14 @@ msgstr "" "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده کنید؟ " "چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. آیا " -"امکان پذیر هست؟ اگر نه چرا؟" +"امکان پذیر هست؟ چرا اره و چرا نه؟" #: src/exercises/day-1/for-loops.md:89 msgid "" "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production quality " "implementation." msgstr "" -"برای دیدن یک پیاده سازی برای محیط پروداکشن به جعبه [`ndarray``ndarray`](https://docs.rs/ndarray/) سر بزنید." #: src/exercises/day-1/for-loops.md:94 @@ -4055,7 +4055,7 @@ msgid "" "preview of issues of ownership that will come later in the afternoon." msgstr "" "استفاده از ارجاع `&array` در بخش `for n " -"in &array` پیش‌نمایشی از مسئله مالکیت است که بعداً توی قسمت عصر به ان " +"in &array` پیش‌نمایشی کوچکی از مسئله مالکیت است که بعداً توی قسمت عصر به ان " "خواهیم پرداخت." #: src/exercises/day-1/for-loops.md:100 @@ -4118,15 +4118,14 @@ msgstr "" #: src/pattern-matching.md:25 src/pattern-matching/match-guards.md:22 #: src/structs.md:31 src/methods.md:30 src/methods/example.md:46 msgid "Key Points:" -msgstr "نکات کلیدی" +msgstr "نکات کلیدی:" #: src/control-flow/blocks.md:46 msgid "" "The point of this slide is to show that blocks have a type and value in " "Rust. " msgstr "" -"هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " -"بازگشتی هستند." +"هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار هستند. " #: src/control-flow/blocks.md:47 msgid "" @@ -4139,7 +4138,7 @@ msgstr "" #: src/control-flow/if-expressions.md:1 msgid "`if` expressions" -msgstr "عبارت `if`" +msgstr "عبارات `if`" #: src/control-flow/if-expressions.md:3 msgid "" @@ -4169,7 +4168,7 @@ msgstr "" #: src/control-flow/for-expressions.md:1 msgid "`for` loops" -msgstr "حلقه `for`" +msgstr "حلقه‌های `for`" #: src/control-flow/for-expressions.md:3 msgid "" @@ -4216,7 +4215,7 @@ msgstr "" #: src/control-flow/while-expressions.md:1 msgid "`while` loops" -msgstr "حلقه `while`" +msgstr "حلقه‌های `while`" #: src/control-flow/while-expressions.md:3 msgid "" @@ -4262,7 +4261,7 @@ msgstr "در این مورد، پس از 3 تکرار حلقه `inner`، از ح #: src/control-flow/loop-expressions.md:1 msgid "`loop` expressions" -msgstr "عبارت `loop`" +msgstr "عبارات `loop`" #: src/control-flow/loop-expressions.md:3 msgid "" @@ -4362,7 +4361,7 @@ msgstr "" #: src/basic-syntax/static-and-const.md:1 msgid "Static and Constant Variables" -msgstr "استاتیک ها و ثابت ها" +msgstr "متغیر‌های ایستا و ثابت" #: src/basic-syntax/static-and-const.md:3 msgid "" @@ -4370,7 +4369,7 @@ msgid "" "scoped values that cannot be moved or reallocated during the execution of " "the program. " msgstr "" -"متغیرهای `ثابت` و `ایستاتیک` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال " +"متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال " "(قابل دسترس در کل برنامه) هستند که نمی‌توانند در طول اجرای برنامه منتقل یا " "دوباره تعریف شوند." @@ -4412,7 +4411,7 @@ msgid "" "Static variables will live during the whole execution of the program, and " "therefore will not move:" msgstr "" -"متغیرهای ایستاتیک در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل " +"متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل " "نمی‌شوند:" #: src/basic-syntax/static-and-const.md:38 From bb4390e1c6a59cee3e59867a828584818d9d7bd1 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Sat, 2 Dec 2023 14:33:32 +0330 Subject: [PATCH 23/23] reformated --- po/fa.po | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/po/fa.po b/po/fa.po index 7dbbaafce4f1..e3aea8ebe072 100644 --- a/po/fa.po +++ b/po/fa.po @@ -3970,10 +3970,10 @@ msgid "" "and a function `transpose` which will transpose a matrix (turn rows into " "columns):" msgstr "" -"از کد بالا برای نوشتن تابع `pretty_print` که یک " -"ماتریس را به صورت `pretty-print` چاپ می‌کند و تابع " -"`transpose` که یک ماتریس را جابجا می‌کند (ردیف‌ها را به " -"ستون‌ها تبدیل می‌کند) استفاده کنید: " +"از کد بالا برای نوشتن تابع `pretty_print` که یک ماتریس " +"را به صورت `pretty-print` چاپ می‌کند و تابع `transpose` که یک ماتریس را جابجا می‌کند (ردیف‌ها را به ستون‌ها " +"تبدیل می‌کند) استفاده کنید: " #: src/exercises/day-1/for-loops.md:49 msgid "Hard-code both functions to operate on 3 × 3 matrices." @@ -4055,8 +4055,8 @@ msgid "" "preview of issues of ownership that will come later in the afternoon." msgstr "" "استفاده از ارجاع `&array` در بخش `for n " -"in &array` پیش‌نمایشی کوچکی از مسئله مالکیت است که بعداً توی قسمت عصر به ان " -"خواهیم پرداخت." +"in &array` پیش‌نمایشی کوچکی از مسئله مالکیت است که بعداً توی قسمت عصر " +"به ان خواهیم پرداخت." #: src/exercises/day-1/for-loops.md:100 msgid "Without the `&`..." @@ -4125,7 +4125,8 @@ msgid "" "The point of this slide is to show that blocks have a type and value in " "Rust. " msgstr "" -"هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار هستند. " +"هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " +"هستند. " #: src/control-flow/blocks.md:47 msgid ""