From 9ddc51a945fc74469227211ee188bbaa5c3633f9 Mon Sep 17 00:00:00 2001 From: Amin Sharifi Date: Sat, 4 Nov 2023 17:41:07 +0330 Subject: [PATCH] fa: Translate Part `3` , `4` , `5` ,`6.1`, `6.2`, `6.3` (#1439) Part of #671 - Translate Part `3` , `4` , `5` ,`6.1`, `6.2`, `6.3` --------- Co-authored-by: Hamid R. K. Pisghadam Co-authored-by: Kaveh --- po/fa.po | 445 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 327 insertions(+), 118 deletions(-) diff --git a/po/fa.po b/po/fa.po index 3aea7c3bdaa..397cfe072be 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 "" @@ -1367,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 "" @@ -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 و آرایه‌ها." #: 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,10 @@ 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 +2146,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 +2174,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 +2236,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 +2265,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 دارای ماکروهای hygienic است، `println!` یک " +"نمونه از این است." #: src/hello-world.md:18 msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." msgstr "" +"رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد " +"باشند." #: src/hello-world.md:22 msgid "" @@ -2284,22 +2299,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, یک زبان مدرن با پشتیبانی کامل از چیزهایی مانند یونیکد است." #: 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 +2331,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 +2343,15 @@ 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 +2371,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 { // محاسبات مانند بقیه زبان ها \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 +2393,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 +2403,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 +2433,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 +2476,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 +2489,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 +2546,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 +2602,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 +2612,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 +2622,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 +2639,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 +2707,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 "تکرارکننده‌ها (`iterators`) هیچگاه نامعتبر نمی‌شوند.." #: 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 +2760,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 +2771,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) استفاده کنید تا کامپایلر «مقدار» را فراموش " +"کند (به این معنا که تابع مخرب (`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/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 +2820,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 +2834,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 "پشتیبانی عالی از LSP‌." #: src/why-rust/modern.md:23 msgid "" @@ -2765,6 +2892,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 +2904,10 @@ msgid "" "known as 'sum types', which allow the type system to express things like " "`Option` and `Result`." msgstr "" +"ارزش ذکر را دارد که Enum‌های زبان Rust از «انواع داده جبری» هستند که همچنین " +"به عنوان «انواع جمع» شناخته می‌شوند، که به تایپ‌ سیستم اجازه می‌دهد چیزهایی " +"مانند `Option` و `Result` را بیان کند." #: src/why-rust/modern.md:32 msgid "" @@ -2780,6 +2916,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 +2927,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 +2956,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 +2967,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 +2977,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 +3061,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 +3092,7 @@ msgstr "" #: src/basic-syntax/scalar-types.md:10 msgid "Booleans" -msgstr "" +msgstr "بولین‌ها" #: src/basic-syntax/scalar-types.md:10 msgid "`bool`" @@ -2933,27 +3104,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 +3132,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 +3149,52 @@ 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 +3203,15 @@ 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 "" +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 ""